Hi there.
I'm sure this question has a simple solution. Googling hasn't yielded any results.
I've gone into Confluence > Admin > Layouts and attempted to edit the code diretly to achieve some functionality my company is looking for. I've created variables and output them successfully.
Unfortunately, whenever the variable prints on the page, it is surrounded in quotes ony visible in the source code. This breaks any HTML output that I'm trying to put in.
Specifically:
#set( $foo = "<p>Hello World</p>" )
$foo
...will output "<p>Hello World</p>" without the quotes on the page, and " <p>Hello World</p> " with the quotes in HTML.
What am I missing? How can I get it to output just the string so that the HTML parser will recognize it?
Community moderators have prevented the ability to post new answers.
Solution: Add ""WithHtml" to the viarable name. So "$foo" becomes "$fooWithHtml".
Please try to put #disable_html_escaping() before you use set directive. Please note that it will bring you potential security vulnerabilities.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the quick response Alexi.
I actually ended up appending my variable names with "WithHtml" and that fixed it.
so...
#set( $fooWithHtml = "<p>Hello World</p>" )
$fooWithHtml
...now outputs...
"Hello World" on the page and "<p>Hello World</p>" without the quotes in the code.
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.