We have a user macro with a parameter of type confluence-content. When we try to get the page with a title containing special characters e.g. "This & That", the parameter returns the title encoded "This & That". So when trying to get the page from the pageManager, the page is not found. Is there a possibility to avoid the encoding of a parameter?
When using the confluence-content type for a parameter, only "spaceKey:pageTitle" is available for rendering the velocity template. I replaced the known entities now, but this is not generic and I didn't found a decoder, which is available in the rendering context and no way to avoid the encoding of the parameter.
I have never used that parameter type, but there are others that don't work the way you think they would. User macros are in need of TLC for quite some time. It is a shame, but they are not maintaining this very powerful tool, and given the forced move to the cloud, user macros will only be available to data center customers -- larger entities that have resources to program full-blown plugins.
@Michael AmmannI found this article when researching another topic:
What is interesting is that they are using the confluence content type in a user macro and converting it back into a page object. I think that will solve your problem as once it is an objects, the usual methods can be used.
Let me know if this helps
In our macro we make quite the same as mentioned in this article. But as the link contains the page title, we have the problem that the title is escaped and e.g. the & is replaced by the html entity & If there is no way to avoid this conversion, the page tile has to be decoded again and I found no velocity helper to do this for all cases.
Go “behind the screen” to meet some of the Confluence Cloud team. In this video series, we tackle some of the hard-hitting questions you never knew you wanted the answer to! Meet some of the ...
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