Dear all,
I try to make a user macro where hide different content based on a status text which is stored inside Status Handy.
<ac:structured-macro ac:macro-id="xxxxx" ac:name="status-handy" ac:schema-version="1">
<ac:parameter ac:name="Status">n/a</ac:parameter>
<ac:parameter ac:name="id">19969</ac:parameter>
</ac:structured-macro> <time datetime="2019-01-01"/>
so when Status is n/a i do not want to show a date.
With $body in the user macro, i only get the interpreted string, but not the HTML parsable string.
Any comments how to do so ?
## This is an example macro
## @param Search:title=Search term|type=string|required=true|desc=Enter your searchterm#if($body.contains($paramSearch))
Found! "$body"
#else
Not found !
#end
thx
Robin
This might be a good use case of wrapping that macro in a user macro so that it is easier to control. Where the user macro actually controls and inserts the second macro.
For an example of a wrapper macro, see Getting Started with User Macros - Writing a Wrapper Macro
(Disclaimer, I am the author of the article.)
I tried to wrap that macro into a user macro. Actually its even this:
- User Macro 1: show final result
-- User Macro 2: so parse the HTML Content of the macro inside this macro
--- any Macro (e.g. status-handy)
But the problem is now, how can i modify the content inside the User Macro 2?
I feel more and more, that i need to develop an own macro using IDE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you are making it too hard. I would use the wrapper macro to set the parameter you need for the status-handy macro (plus any others). Then you can conditional show the macro based on that macro and now have to worry about parsing the body.
In the wrapper macro, there woudl be no body.
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.
Hi Robin,
Have you tried to change Macro Body Processing like Escaped or Unrendered?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aleksandr,
Unfortunately this is not working, because i need to have the HTML Content to parse the code inside another macro, but need to show then the final result.
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.