This article discusses the recommended way of how URLs must be used in correlation with profiles in the Markdown from a URL macro HTML and XSLT macros. The best practice is to specify both, profile and a relative path, in the macromacros' s configuration. In this way, you can access multiple locations through the same profile, and render Markdown HTML or XML content on your pages.
Description
With the Markdown from a URL macro, you You can connect to an external application or location through a URL and display relevant content on your page. For this purpose, the macro allows macros allow you to use profiles and URLs to specify the complete path to access the required application data.
...
First, it is important to understand how the macro behaves with profiles and URLs. The correlation between URLs and profiles with respect to the macro can be explained as:
Is Profile given? (Y - Yes, N - No) | Is |
---|
Location given? (Y - Yes, N - No) | Macro behavior | |
---|---|---|
Y | N | Accesses the URL specified in the profile through the pre-configured information. |
N | Y | Accesses the URL specified and renders the |
HTML or XML content as required. | ||
Y | Y | Appends the URL mentioned in the |
Location of HTML data or Location of XML data parameter to the URL configured in the profile. Thus, the macro creates |
an absolute path to the |
required file. If this path is not valid, a network error message is displayed. To resolve this issue, contact your Confluence administrator for more information. |
How
...
Create or edit a page and add the Markdown from a URL macro.
...
Edit the macro and the macro editor appears.
...
it all works
For this example, let’s assume the profile has the following values specified:
Note |
---|
Here, the profile is linked to GitLab and the URL shown is the base URL of the application that the macro fills automatically. See the Additional links section for more information about GitHub and GitLab profile creation. |
Create or edit a page, add the Markdown from a URL macroHTML macro for this example, and, edit it to open the macro editor.
Enter a relative path (partial URL) to an attachment in URL Location to markdown fileHTML data.
Note As mentioned, the macro appends the relative path in the URL to markdown file Location of HTML data with the base URL given in the profile. If this path is valid, the file(s) are read and the Markdown HTML content is displayed, else, a network error is displayed.
Save the macro and publish the page to see the content.
Info | ||
---|---|---|
| ||
|
Anchor md_tutorials_URLProfiles_AddlLinks md_tutorials_URLProfiles_AddlLinks
Additional links
md_tutorials_URLProfiles_AddlLinks | |
md_tutorials_URLProfiles_AddlLinks |