This article discusses the recommended way of how URLs must be used using URLs, especially in correlation with profiles, in the Markdown from a URL macro. The best practice is to specify both, profile and a relative path, in the macro's configuration. In this way, you can access multiple locations through the same profile and render Markdown content on your pages.
Description
With the Markdown from a URL macro, you Html-bobswift and XSLT macros. This page also contains more information about the URLs that can be given, the order used to process URLs, and finally, how URLs must be used with profiles in the macros.
|
---|
You can connect to an external application or location through a URL and display relevant HTML/XML content on your pagepages. 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. The best practice though, is to specify both, a profile with a base URL and a relative path in the Location fields in the macros configuration. This way, you can access multiple locations through the same profile, and render HTML/XML content on your pages.
Info |
---|
Contact your Confluence administrator to to know which profiles are available in your instance. |
Anchor | ||||
---|---|---|---|---|
|
First, it is important to understand how the macro behaves with profiles and URLs. macro processes profiles and URLs. A URL provided in a macro can be:
an absolute URL that can be used to access the relevant HTML/XML file,
a relative path to the actual location of the file to be rendered, or
an application link (a link between Confluence and another Atlassian application such as Bitbucket or Jira).
Anchor | ||||
---|---|---|---|---|
|
URLs given in the macros are processed in the following order as explained:
Priority given | URL type | Description |
---|---|---|
1 | Application links | If the given URL is linked to a specific application like Bitbucket or Jira, the macro does not require any user credentials, and processes and renders the given file. Refer to application links for information. |
2 | Profiles | If Profile is specified, the macro appends the URL given here with the URL specified in the profile configuration, and accesses the location to render the required file. |
3 | Simple URLs | Lastly, if no application links or profiles were given, the URLs are processed as-is and the required file is rendered. |
Anchor | ||||
---|---|---|---|---|
|
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 |
(s) 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 the macro works
...
Create or edit a page and add the Markdown from a URL macro.
...
Edit the macro and the macro editor appears.
...
Anchor | ||||
---|---|---|---|---|
|
Profile configuration
For this example, let’s assume the profile has the following values specified:
...
Note |
---|
|
...
|
...
|
Macro editor settings
...
Create or edit a page, add the
...
Html-bobswift macro (for this example), and
...
edit
...
to open the macro editor.
Select the relevant profile in Profile.
Enter a relative path (partial URL) to
...
access the required file in Location to HTML data.
Note As mentioned, the macro appends the relative path in the
...
Location of HTML data with the base URL given in the profile. If this absolute path is valid, the specified file
...
is read and the
...
HTML content is displayed, else, a network error is displayed.
Save the macro and publish the page to see the content.
Info | |
---|---|
title | Points to remember:
|
Anchor |
---|
...
|
...
|
...
|
...
|