Hi Folks, here is an idea, will it work ?
I always meant to ask, if I can perform string-operations on the page titel in usermacros.
The pagetile says "Introduction (Version 1.0)"
The pagebody says something like
h2. Introduction This is the introduction to the page .....
Now my question : Could I write a usermacro, that takes "Introduction (Version 1.0)" and does something like
h2. {left($pagetitle,pos($pagetitle,"("))}
So basically to cut off anything from "(" onward ?
Regards, Josch
Yes you can do this .... here is an example usermacro code
## @noparams #set($charIndexToSlice = $content.title.indexOf("(") ) #set($charIndexToSlice = $charIndexToSlice - 1 ) #if($charIndexToSlice > -1) $content.title.substring(0,$charIndexToSlice ) #end
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.