Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

User macro not working: Horizontal scroll bar appearing and excerpt not working with include

Good morning,

I am trying to write my first macro...and it is not working as expected.

1. When it is added to a page and there is more than one line of text in the $body it is displaying with a horizontal scroll bar.

2. I tried to use it with the excerpt include macro and the $body text is not appearing.

Any assistance would be appreciated, here's how I pulled it together:

## @param Url:title=Image URL|type=string|required=true|desc=Link for the background image

## Use UI Image to create hero banner using page name and specified height
<ac:layout>
<ac:layout-section ac:type="single">
<ac:layout-cell>
<p>
<ac:structured-macro ac:name="ui-image" ac:schema-version="1">
<ac:parameter ac:name="imageUrl">"${paramUrl}"</ac:parameter>
<ac:parameter ac:name="title">$content.title</ac:parameter>
<ac:parameter ac:name="height">200px</ac:parameter>
</ac:structured-macro>
</p>
</ac:layout-cell>
</ac:layout-section>

## Add three columns with navigation elements in UI expand
<ac:layout-section ac:type="three_equal">
<ac:layout-cell>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:name="ui-expand" ac:schema-version="1">
<ac:parameter ac:name="title">Content on page</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:name="toc" ac:schema-version="1">
<ac:parameter ac:name="maxLevel">2</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:layout-cell>
<ac:layout-cell>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:name="ui-expand" ac:schema-version="1">
<ac:parameter ac:name="title">Attachments on page</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:name="attachments-list" ac:schema-version="1"/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:layout-cell>
<ac:layout-cell>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:name="ui-expand" ac:schema-version="1">
<ac:parameter ac:name="title">Related content</ac:parameter>
<ac:rich-text-body>
<p>
<strong>
<ac:structured-macro ac:name="pagetree" ac:schema-version="1"/>
<br/>
</strong>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<p class="auto-cursor-target">
<br/>
</p>
</ac:layout-cell>
</ac:layout-section>

## Add DivBox and Excerpt Macro with forced formatting
<ac:layout-section ac:type="single">
<ac:layout-cell>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:name="divbox" ac:schema-version="1">
<ac:parameter ac:name="style">font-size:18px;font-weight-400</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:name="excerpt" ac:schema-version="1">
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>$body</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:layout-cell>
</ac:layout-section>

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
Community showcase
Published in Confluence Cloud

Confluence Bingo Round 3!

That’s right! Grandma’s back at it again, and this time she’s brought all her friends. In honor of Team '21, this Bingo round is dedicated to all things team-related, and the prizes are no exception....

3,132 views 31 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you