Need Assistance Creating an Alpha List Macro

Zabrina Shkurti August 26, 2019

Hello, all!

I am in need of an alpha list for my documentation in Confluence. I have tried creating a user macro to accomplish this. The macro is as follows:

## @Param Title:title=Tip|type=string|desc=Title
<div>
<ol style="list-style-type: upper-alpha;">
<li></li>
<li></li>
<li></li>
</ol>
</div>

The issue is that I cannot edit the list. It will show as follows:

A.
B.
C.

But I cannot put anything next to these...any ideas on how to make the list editable? Is there a better way to accomplish this?

1 answer

0 votes
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 26, 2019

Try something like this. Then just put an ordered list into the body of the user macro.

Macro Body Processing:
Rendered

Template:

## @noparams

<style type="text/css">
/*<![CDATA[*/
div.alpha-list ol {list-style-type: upper-alpha;}
/*]]>*/
</style>

<div class="alpha-list">
$!body
</div>
Zabrina Shkurti August 26, 2019

Thanks for your response! I tried this and it took the body but did not have the list (ABC). In other words, in the macro body I put the following:

Alpha 

List 

Here 

Expected result:

A. Alpha

B. List

C. Here

Actual Result:

Alpha 

List 

Here 

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 26, 2019

The problem is that you didn't put a list in the body of the macro. You put in multiple lines of text. Use the numbered list button in the toolbar to put a list into the body of the macro. It will look like a numbered list in the editor, but in view mode it will be an alpha list.

Zabrina Shkurti August 27, 2019

Hey, Davin! Thanks for your response! I tried what you said and it kind of worked...I used the numbered list but it rendered with a lowercase alpha list. Any thoughts?

Current macro:

## @noparams
<div>
<ol style="list-style-type: upper-alpha;">
$body
</ol>
</div>

Input into the body:

1. Alpha
2. List
3. Here

Expected Result:

A. Alpha
B. List
C. Here

Actual Result:

a. Alpha
b. List
c. Here

Zabrina Shkurti August 27, 2019

Actually, this doesn't seem to work. Once I open in the viewport, it goes back to a numbered list.

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2019

Looks like your macro code is not the one @Davin Studer  suggested. He has a CSS rule followed by a div tag with class. You then insert your text (in list format) inside the body of the macro (what the $body variable refers to).

But you may also need to write a tighter CSS rule.

The "easiest" way to do this to use the browser inspect function to look at what rules are actually controlling the styling of your text (and overwriting your rule). Often with Confluence you will have write a more specific set of class selectors to get the rule to work

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2019

Using the macro code above that I provided it should look like this in edit mode ...

image.png

And this when the page is viewed.

image.png

Like Bill Bailey likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events