Re: short and long descriptions
Posted by
cadet1620 on
Oct 26, 2011; 11:59pm
URL: https://support.nabble.com/short-and-long-descriptions-tp6927296p6934700.html
I got David's regex idea working.
I could not figure out how to get '[' into the regex pattern parameter. It appears that '[' has special meaning to NAML even within quoted parameters as in
class="app-title-[n.id/]"
and I didn't find a way to quote it so I did without.
The usefulness of regular expressions is limited without [ ]. I hope there's a way to get them in there.
In "subcategories_column" macro I display the short description:
<n.if.current_node.is_app>
----------
<then.current_node.node_message_as_html/>
++++++++++
<then>
<n.regex_replace_all. pattern="\{/?short-desc\}" replacement=" ">
<n.regex_replace_all. pattern="\{long-desc\}.*\{/long-desc\}" replacement=" ">
<n.current_node.node_message_as_html/>
</n.regex_replace_all.>
</n.regex_replace_all.>
</then>
==========
<else>
In "app_body_header" macro I display the long description:
<div id="description-box">
<n.mailing_list_information/>
----------
<n.node_message_as_html/>
++++++++++
<n.regex_replace_all. pattern="\{/?long-desc\}" replacement=" ">
<n.regex_replace_all. pattern="\{short-desc\}.*\{/short-desc\}" replacement=" ">
<n.node_message_as_html/>
</n.regex_replace_all.>
</n.regex_replace_all.>
==========
</div>
--Mark