Page tree
Skip to end of metadata
Go to start of metadata

Playground and DEMO space

This is a playground and demo space for ConfiForms and ConfiDoc addons developed and supported by Vertuna LLC

Most pages provide a storage format for the demo, so you can use the free add-on from Atlassian Confluence Source Editor to import this configuration into your Confluence and see it in action

Please note, all the examples here are provided without any obligation and may or may not be incomplete or may have bugs, and we provide NO SUPPORT for these examples and demos.

This is a quick demo on how you can reuse you ConfiForms configurations by creating user macros

Consider the following form, where the user can choose an option and if an "other" option is selected then the text field is shown to capture the value for the "other"

What we can do is to take out the 3 macros that define the fields and their behaviour and create a user macro that can be reused whenever needed

We take out the storage format for these 3 macro and create a "cf-choices" macro like this

      <ac:structured-macro ac:macro-id="574fb50b-f05d-4fd6-bbaf-941028cdd456" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">choices</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Choices</ac:parameter>
        <ac:parameter ac:name="values">false[1=one|2=two|3=three|4=other|]</ac:parameter>
        <ac:parameter ac:name="type">select</ac:parameter>
      <ac:structured-macro ac:macro-id="b355cde9-2e2c-4ffe-8c16-9d7a14c05c0e" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="condition">!choices:4</ac:parameter>
        <ac:parameter ac:name="fieldName">otherChoice</ac:parameter>
        <ac:parameter ac:name="action">Hide field</ac:parameter>
        <ac:parameter ac:name="actionFieldName">choices</ac:parameter>
        <ac:parameter ac:name="withReverseRule">true</ac:parameter>
      <ac:structured-macro ac:macro-id="17ef6a3a-7550-402a-abb4-a6d8146ef8d3" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">otherChoice</ac:parameter>
        <ac:parameter ac:name="fieldLabel">What is you choice?</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>

So, in the end the macro configuration for the user looks like this

See the online demo below

  • No labels