I insert one excerpt macro and embed one HTML macro into it on page A, the excerpt displays the value of HTML macro(550) correctly on page A; On page B, I inserted on excerpt include to include excerpt on page A, but it shows NaN on page B, BTW,the value has been transferred to string format, I also tried to output the value direct in JS but it is not available in JS currently after checking(if you know a way to do so, be sure to tell me, thanks in advance). Here attached screenshots of page A and page B for details.
Page A with excerpt:
Page A outcome:
Page B outcome:
Woops, I find the root cause, the HTML macro is executed on Page B.
Any way to limit HTML macro to be executed on page A only ?
Hi Will,
There's not a native way in Confluence to prevent the HTML macro from being run in an excerpt macro, but there may be a workaround with Javascript. I'd try wrapping the logic in a conditional statement that checks the title of the page.
For example (have not yet tested):
const pageTitle = document.querySelector('#title-text a').innerText; // Get title of page
if (pageTitle === "My Original Page") {
// Insert logic here that you only want on "My Original Page"
}
I hope this helps!
– Zak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Zak,
Noted with thanks. But I also need to get the table of source page(Page A).
i have choose solution that use load() formula in page B to get the data on Page A and get everything done in page B. Below is one sample of load()
$("#title-text").load("URL tbody",function(response){
insert the logic here
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.