Page 1 of 1

[SOLVED!] (See post 4 ) Menus: Stopping and Starting

Posted: Mon Aug 27, 2012 2:17 am
by Andrew Prior
I understand nodes and hierarchy, and also how to specify particular menu items by listing them by name. But is there a way where I could do this:

Menu [/parameter]
Some other code: maybe a graphic
Menu [/parameter: continue]

where the parameter would begin listing pages for say 10 items and then stop. And then at the second parameter begin at menu item 11.

Like you can do with news items:

Code: Select all

{news category='SA' summarytemplate='Front_Page_Summary' detailpage='Justice_Detail' detailpage='news-item-details' number='5' start='1'}
note: start='1'
then a picture, then...

Code: Select all

{news category='SA' summarytemplate='Front_Page_Summary' detailpage='Justice_Detail' detailpage='news-item-details' number='20' start='5'}
note: start='5'

Andrew

Re: Menus: Stopping and Starting

Posted: Mon Aug 27, 2012 5:44 pm
by Dr.CSS
Sounds like you want to add an image at certain points in the menu, the only way I know how to do this is to use the Image select in the options tab when editing/making a page, make a new content/page but not of Content type, sectionheader maybe, select an image for that 'page' set it to be the 11th page...

Re: Menus: Stopping and Starting

Posted: Mon Aug 27, 2012 9:37 pm
by mrenigma
You could definitely do something like this using smarty sections:
http://www.smarty.net/docsv2/en/languag ... ection.tpl

I would assign a start and max variable before calling the menu tag. Then the image you would like followed by a rewrite of the start and max variables with a new menu tag after...and repeat.

Some pseudo-code:

Code: Select all

{assign var="start" value=1}
{assign var="max" value=5}
{Menu template="imageMenu"}
<img alt="" title="" src="" />

Re: Menus: Stopping and Starting

Posted: Sat Sep 08, 2012 1:08 pm
by Andrew Prior
Dr CSS, thankyou. Your showed me the way although it nearly killed me getting there, being ignorant :-)

I made a copy of the simple_menu.tpl in the menu manager.

In that I changed this code

Code: Select all

{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}</span>
I removed the node->menu text and added the code which refers to the image that you set in the page options.

Code: Select all

{elseif $node->type == 'sectionheader'}
<li class="sectionheader"><span><img src="{$node->image}"  /></span>
I then made a copy of my template, which affects very many pages which I did not want to change and changed the menu to my new adjusted template to test it.

When it was ok I changed the section I wanted to contain images to the new template and added two pages which are section headers instead of being content pages.

You can see this at http://onemansweb.org/theology/a-diffic ... -1-26.html for example. (Note that the large image below the menu is not part of the menu code. The two small images of the windmill and the church are produced by the menu template.)

Thankyou very much for your assistance. Andrew Prior

Re: [SOLVED!] (See post 4 ) Menus: Stopping and Starting

Posted: Sat Sep 08, 2012 10:27 pm
by Dr.CSS
Glad you got it, you might want to check it in html validator and for the menu images you do an alt...

<img src="{$node->image}" alt='{$node->menutext}' />