Examples - list select macro

Example 5 Adding a column as a dropdown metadata Yes/No selection for each item

You can define a column as a selection.

Let's say we need to define whether or not the oviparous (the egg laying animals) are swimmers.

So we add the following list macros

  • list macro filtered by the label oviparous

  • list-excerpt macro to display the classification in a column.

  • list-select macro with the values yes and no, for the last column of the list.

For the list-select macro that we did not select the checkbox for Use labels, meaning that we are using a metadata value instead of a label.

Markup
{list:label=oviparous|name=Swimmers|useboards=false} {list-excerpt:heading=Classification|width=10} {list-select:heading=Can swim?} Yes No {list-select} {list} 

This displays the following lists:


The metadata value for the Can Swim? metadata can be accessed later using list-attribute or any of the Comala Metadata macros.

For the  list-attribute macro, we indicate the attribute and the page

If the page is left blank in the Edit macro dialogue box, the macro will seek the Can Swim? metadata value from the current page.

In our example, the metadata values are displayed for the page specified in each of the macros.

The example uses a Confluence table to display each question and the metadata value.


Markup

Can eagles swim? {checklist-attribute:attribute=Can swim?|page=Bald Eagle} Can frogs swim? {checklist-attribute:attribute=Can swim?|page=Common Frog}

Example 6 Adding a column as a dropdown label selection for each item

list-select macro selection could use labels instead of metadata values.

Similar to Example 2, but in this example the actual labels used are birdfish, mammalamphibian or reptile but each option could have a different value from the actual caption. 

For example, the caption for the label fish is It's a fish, or for bird is It's a bird

In the body of the list-select macro each caption is defined as <value>|<caption>.

The  <value> is the actual label, the <caption> is the actual caption displayed.

The markup for this example is

Markup

Example 7 Adding a column as a dropdown user selection for each item

Users can also be selected using the list-select macro.

You can configure the list-select macro using the Edit macro dialogue box.

Users can be added as choices in the drop-down menu on the page by either:

  • using a Confluence group name to allow selection from the users who are members of the group.

  • using all to allow selection among all the existing users in the instance.

Markup

In the list-select macro

  • if there is only one option to select from and store is set to checklist

  • then the column is handled as a checkbox

For further details - Example 11.