Advanced Codeblocks Multi

Learn about the special features of the Advanced Codeblocks Multi and get inspiration from specific examples.

The Advanced Codeblocks Multi is used for inserting the config-block and template directly in Confluence.

Parameters

Title

Define the title of your codebox.

Show Download links

Decide to show download links or to hide this function.

Expand first codeblock

Select the first codeblock of your codebox expanded.

Programming language

Select your language from over 150 programming languages or let your language detect automatically.

Theme

Select your theme from 4 themes.

User Interface

The user interface on your Confluence page will look like the example below. You can collapse and expand the codeblocks at any time to save space or to show the code when you need it.

Download Feature

The Download Feature provides you different options to directly download your configuration in the setting you need. You only have to click the respective Button. Don't forget to enable Show download links in your parameters to use this function.

  • Download codeblock: download the code of your template with replaced variables of the specific codeblock. The link is located on the right side of the header of each codeblock.

  • Download raw: download the raw code of your template with your defined variables accordingly without replacements. The link is located in the menu in the upper right corner of the outer box.

  • Download xml: download a xml list of all download links contained in your configuration. The link is located in the menu in the upper right corner of the outer box.

You can also use the Download Feature to download configs directly from Confluence in your automated provisioning scripts with e.g. curl or wget via HTTP REST API. This option is broadly explained in the basics.

Note for using the Download Feature

  • By changing the section name the download link changes.

  • By moving the macro to another Confluence page the download link changes.

Read-only mode (Data Center)

Since Advanced Codeblocks v2.5.0 and for Confluence Data Center versions higher or equal 6.10 the Read-only mode for Confluence Data Center is supported.

When the Read-only mode is activated, the Advanced Codeblocks will render with disabled download features, since they would perform a write operation on the page properties. The user will see the message read-only mode is active on top of the menu.

Examples

Example 1

Example 1 - Apache
[testsystem 1]
server.domain = www.myserver1.com
document.root = /www/server1
[testsystem 2]
server.domain = www.myserver2.com
document.root = /www/server2

[content]
Listen 80
<VirtualHost *:80>
   ServerName ${server.domain}
   DocumentRoot "${document.root}"
</VirtualHost>