Hi
I am trying to add a non linkable sub title to a menu item
something like this:
Test Page (link to page)
subtitle (short description)
I have put this code in the template:
<h2>{content block="Subtitle" oneline="true" wysiwyg="false"}</h2>
Which gives me a one line entry in the admin but how can this be shown on a menu below the page link.
I am using the latest version of CMSMS
I trust that makes some sense.
Thanks
How to add sub-title to menu
Re: How to add sub-title to menu
You could use CGSimpleSmarty to get the contents of that content block. Read the help of that module to find to proper method.
That said, think about this:
Pages have three extra fields named 'Extra Page Attribute n' which by default are on the Options tab when you add/edit a page.
Those fields are 'cheaper' to use as they (by default) will be available in the Menu Manager (if NOT loadprops=0 is used in the {menu} tag).
You can use the field in Menu Manager template by {$node->extra1} (or 2 or 3).
To get that field to the main tab have a look at the 'Basic Properties' multi-select field in Site Admin > Global Settings > Content Editing Settings.
You can't however not set another label (unless you're willing to use a custom admin template for that action).
That said, think about this:
Pages have three extra fields named 'Extra Page Attribute n' which by default are on the Options tab when you add/edit a page.
Those fields are 'cheaper' to use as they (by default) will be available in the Menu Manager (if NOT loadprops=0 is used in the {menu} tag).
You can use the field in Menu Manager template by {$node->extra1} (or 2 or 3).
To get that field to the main tab have a look at the 'Basic Properties' multi-select field in Site Admin > Global Settings > Content Editing Settings.
You can't however not set another label (unless you're willing to use a custom admin template for that action).
Re: How to add sub-title to menu
Hi Velden
Thanks for your reply. I like the idea of using standard items but I've got myself lost in the process.
I am using the standard template simple_navigation.tpl and added the menu to a page but stripped out the top level with this {menu start_level='2' collapse='1' } I am trying to add the subtitle with this level.
In the template I have removed the loadprops=0 from the tag.
But unable to figure out were to set / add the {$node->extra1} in the template. Can you explain a little deeper.
Thanks
Thanks for your reply. I like the idea of using standard items but I've got myself lost in the process.
I am using the standard template simple_navigation.tpl and added the menu to a page but stripped out the top level with this {menu start_level='2' collapse='1' } I am trying to add the subtitle with this level.
In the template I have removed the loadprops=0 from the tag.
But unable to figure out were to set / add the {$node->extra1} in the template. Can you explain a little deeper.
Thanks
Re: How to add sub-title to menu
If you're using a standard menu template you need to copy it to the database to be able to customize it. I assume you know about that?
You then make it either the default Menu Manager template or use the template parameter in the {menu} tag.
Then within the foreach loop of Menu Manager template, wherever you need the sub title to appear you can use the {$node->extra1} 'variable'
Or something like (untested): {if !empty($node->extra1)}{$node->extra1}{/if}
Obviously something should be filled in that field per page.
You then make it either the default Menu Manager template or use the template parameter in the {menu} tag.
Then within the foreach loop of Menu Manager template, wherever you need the sub title to appear you can use the {$node->extra1} 'variable'
Or something like (untested): {if !empty($node->extra1)}{$node->extra1}{/if}
Obviously something should be filled in that field per page.
Re: How to add sub-title to menu
Hi again
I've got it working just need to find how to add some css to it now.
Many thanks.
I've got it working just need to find how to add some css to it now.
Many thanks.
Re: How to add sub-title to menu
Hi Velden
All done just thought you would like to see your handy work of the finished menu.
Image attached.
Many thanks
All done just thought you would like to see your handy work of the finished menu.
Image attached.
Many thanks