Hi,
I'm developing a blueprint that creates a new space with a hierarchy pages, some of which contain macros such as the livesearch macro. How can I ensure the current spaceKey is set inside a template for a newly created space.
I had understood that I could use the at:var syntax in thesrc/main/resources/xml/space-home.xml
<at:var at:name="spaceKey" />
For example:
<p> <ac:structured-macro ac:name="livesearch"> <ac:parameter ac:name="placeholder">Search this customer</ac:parameter> <ac:parameter ac:name="spaceKey"> <ri:space> <ri:space-key> <at:var at:name="spaceKey" at:rawxhtml="true"/> </ri:space-key> </ri:space> </ac:parameter> </ac:structured-macro> </p>
Is there a way to do this? - Do I have my syntax wrong?
Thanks,
Ewen
Community moderators have prevented the ability to post new answers.
OK.... syntax problem....
It was the surrounding xml that I actually had wrong, refactored like this and it works.
<p> <ac:structured-macro ac:name="livesearch"> <ac:parameter ac:name="placeholder">Search this customer</ac:parameter> <ac:parameter ac:name="spaceKey"> <at:var at:name="spaceKey" /> </ac:parameter> </ac:structured-macro> </p>
Sweet!
Ewen
It works on creation and I have used this for quite a while. But once you edit and save the page and you want to revert to the original page version later, you'll get a " java.lang.ClassCastException: java.lang.String cannot be cast to com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.ResourceIdentifier". So it seems that not all uses cases for using a String instead of a ResourceIdentifier are properly handled by Confluence. Tested on Confluence 5.4.1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same problem here. I get a ClassCastException, because Confluence seems to expect a space object, not just the space key (as string). How do I get it to expand <at:var...> into the actual space object?? Confluence 5.8.13
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.