how to put two macro on the same line ???

it may be a stupid question, but how do I put two macro like (date-data) on the same line with "(" before and ")" after.

I the text-editor, it seems not possible ?

Here is the code:

<p>(</p>
                              <ac:macro ac:name="number-data">
                                <ac:parameter ac:name="width">30px</ac:parameter>
                                <ac:parameter ac:name="name">heuresuivi</ac:parameter>
                                <ac:parameter ac:name="minValue">1</ac:parameter>
                                <ac:parameter ac:name="format">00</ac:parameter>
                                <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
                                <ac:parameter ac:name="maxValue">24</ac:parameter>
                                <ac:plain-text-body><![CDATA[ ]]></ac:plain-text-body>
                              </ac:macro>
                              <p>h</p>
                              <ac:macro ac:name="number-data">
                                <ac:parameter ac:name="width">30px</ac:parameter>
                                <ac:parameter ac:name="name">minsuivi</ac:parameter>
                                <ac:parameter ac:name="minValue">0</ac:parameter>
                                <ac:parameter ac:name="format">00</ac:parameter>
                                <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
                                <ac:parameter ac:name="maxValue">59</ac:parameter>
                                <ac:plain-text-body><![CDATA[ ]]></ac:plain-text-body>
                              </ac:macro>
                              <p>)</p>

thanks a lot for any help.

sincerly,

Michael

3 answers

1 accepted

Okay. If you were to click just once on one of your number-data elements, do you see a pop-up with two buttons (edit, remove) or 4 (edit, remove, new line, in line)? Hopefully you can see all 4 and choose the inline option.

It might be worth removing the hidden-data element, but keeping its contents, as perhaps it is having an effect on how the two date-data elements and the h are being displayed.

Alternatively, why don't you just use one date-data field to show the hours and the minutes (as well as the date). There's a display format parameter you can set to control how the date/time is displayed:

dd MMM yyyy (hh:mm)

Okay,

I removed the hidden-data and it is working now. The inline act as it should :-).

The reason why I use two date-data is because i re-use the hour in another field for resuming...

Tanks a lot.

Michael

Hi Michael,

You have the key element already:

&lt;ac:parameter ac:name="atlassian-macro-output-type"&gt;INLINE&lt;/ac:parameter&gt;

It's the p tag containing the "h" that you need to eliminate. There are times when that's easier said than done, so we've ended up adding the following script to pages using scaffold fields where we saw an excess of white space:

&lt;script type="text/javascript"&gt;
jQuery(document).ready(function() {
  //Check each p tag to see if it's empty. Whitespace or non-breaking spaces constitute empty too.
  jQuery('p').each(function() {
    var $this = jQuery(this);
    if($this.html().replace(/\s|&amp;nbsp;|&lt;br&gt;|/g, '').length == 0)
        $this.remove();
  });
});
&lt;/script&gt;

We put this script into a wiki page of its own, then just include it on pages needing to trim white space.

You could go down the same route to eliminating your "<p>h</p>" element.

Hope this helps.

Charles

Hi Charles,

thanks for your post.

Sorry, but I'm not familiar with "atlassian-macro-output-type".

My need is to display "(14h23)" on the same line, meaning "({date-data}h{date-data})".

What would be the code ?

Do I need to insert a wiki markup or can I do this with the new editor ?

Thanks

Michael

Your code already has the atlassian-macro-output-type embedded in the 2 date-data macros you used. If you were using the rich text editor, then some macros including the Scaffolding ones, give the option of saying whether they should be on a new line, or be "in-line". Looks like you've already found that and set the appropriate option.

How do things look in the new editor? If you could post a screen capture that may help get to the bottom of this.

oK.

In yellow what needs to be put on a same line.

the text-editor semms not to act correctly ?

And here is the result after saving the page:

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

681 views 21 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you