-
Notifications
You must be signed in to change notification settings - Fork 19
Macros
#Macros ##Runtime Macros (RMximdex) Ximdex CMS gives you a macro to reference other nodes in Ximdex in an easy way. This macros are called Runtime macros.
@@@RMximdex.pathto(20212)@@@
This will be replace by a path or nodename just after xslt transformation.
The way to call this macros is: @@@RMximdex.macroname(params)@@@
where macroname could be:
-
servername. Return the name for the server node ancestor of the current node.
@@@RMximdex.servername()@@@
-
projectname. Return the name for the project node ancestor of the current node.
@@@RMximdex.projectname()@@@
-
nodename. Return the name for the current node.
@@@RMximdex.nodename()@@@
. See note1 -
dotdot. Return the relative path to the selected node from the path as a chain of “../” to go up to the root * and down to the route.
@@@RMximdex.dotdot(css/main.css)@@@
. (The param goes without quotes). - pathto. Return the path to a node and channel. @@@RMximdex.pathto(20212)@@@
- pathtoabs. Alias for the pathto with absolute path. @@@RMximdex.pathtoabs(20212)@@@
Now we will introduce the most useful and complex macro. ###Pathto. @@@RMximdex.pathto(params)@@@ This will be replace by the path to a node which is inferer from the params. This method can receive an undefined number of parameters and these can define: node, language, nodetype and channel. Parameters in path to must be:
- First param: Idnode or node name.
- Next params: ancestor identificator. path to node, language, nodetype or channel.
@@@RMximdex.pathto(index-ides)@@@
`@@@RMximdex.pathto(20212)@@@`* nodename * string (only if first param)
`@@@RMximdex.pathto(index-ides)@@@`* path to node: * string (only if not first param)
`@@@RMximdex.pathto(index-idex, sectionA/sectionB)@@@`* language: * #int (language identificator)
`@@@RMximdex.pathto(index, #10003)@@@`* channel * number (only if not first param)
`@@@RMximdex.pathto(index-ides, 10004)@@@`* nodetype * $string
`@@@RMximdex.pathto(main.css, $cssfile)@@@`
###Other ways to specify the pathto parameters.
- Idnode:
- id=number.
@@@RMximdex.pathto(id=20212)@@@
- .number
@@@RMximdex.pathto(.20212)@@@
- id=number.
- path to node:
- path=string
@@@RMximdex.pathto(index-ides, path=sectionA/sectionB)@@@
- name=string
@@@RMximdex.pathto(index-ides, name=sectionB)@@@
- path=string
- language:
- #string
@@@RMximdex.pathto(index, #en, path=sectionA)@@@
- lang=string or int
@@@RMximdex.pathto(index, lang=es)@@@
- #string
- channel
- @(int or string)
@@@RMximdex.pathto(index-ides, @10004)@@@
- channel = string or int
@@@RMximdex.pathto(index-ides, channel="web")@@@
- @(int or string)
- nodetype
- nodetype=string
@@@RMximdex.pathto(main.css, nodetype=cssfile)@@@
- nodetype=string
You also can force the path to be relative or absolute. if not, will be the method selected in the configuration of the server.
//Force absolute path
@@@RMximdex.pathto(20120, absolute=true)@@@;
@@@RMximdex.pathtoabs(20120, absolute=true)@@@;
//Force relative path
@@@RMximdex.pathto(20120, relative=true)@@@;
//Otherwise the path method depending on the server config
@@@RMximdex.pathto(20120)@@@;
####Note 1
@@@RMximdex.nodename()@@@
return the name after Xsl transformation. To get the nodename in Xsl check the docxap's attributes.
####Note 2 If the expresion in pathto is not determinist, the node selected will be the first from all the possible nodes.