Menu with images help

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
kernow567
Forum Members
Forum Members
Posts: 13
Joined: Fri Feb 04, 2011 4:01 pm

Menu with images help

Post by kernow567 »

Hi
I am new to this and not as yet very good! however what I am trying to do is assign an image on a page to the menu.

The menu then shows the image for that page.

In the template i have

{content_module block="menuimage" module="GBFilePicker" mode='browser' label="Menu Image " dir="images/small" scaling_width="50px" scaling_height="50px" assign="menuimage1" page_tab="Images" block_tab="1 Menu Image" description="Select menu image for this page"}

And then the menu I have

{foreach from=$nodelist item=node}
<a href="{$node->url}">
<img src="{uploads_url}/{$menuimage1}" width="50px" height="50px"/></a>
{/foreach}


Well the menu image works but only shows all the same image from the page you are on.

How can I assign a image per page so that the menu has a different image for each page.

Thanks very much if you can help me a little!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Menu with images help

Post by Dr.CSS »

kernow567
Forum Members
Forum Members
Posts: 13
Joined: Fri Feb 04, 2011 4:01 pm

Re: Menu with images help

Post by kernow567 »

Hey Dr thanks for the reply. I have read through the link and visited the external page but still cant get it to work in the way I required.

Ok I can get it to work with using the thumbnail option so this might help someone else

here is the code for that

in menu manager call it say imager

and paste this code

{foreach from=$nodelist item=node}
<a href="{$node->url}">
<img src="{$node->thumbnail}" width="50px" height="50px" />
<h5>{$node->menutext}</h5></a>

{/foreach}

In your template or page add

{menu number_of_levels="1" template="imager" }

Go to your page click on options and add a thumbnail ( you will have had to have uploaded some images for this option to be available)
-----------------------------------------------------------------------------
However as I explained I was trying to use a call from a
image input in the template using advanced content

{content_module block="menuimage" module="GBFilePicker" mode='browser' label="Menu Image " dir="images/small" scaling_width="50px" scaling_height="50px" assign="menuimage1" page_tab="Images" block_tab="1 Menu Image" description="Select menu image for this page"}

I tried using {$content_obj->GetPropertyValue('image')} from your example

So for instance

{foreach from=$nodelist item=node}
<a href="{$node->url}">
<img src="{$content_obj->GetPropertyValue('menuimage1')}" width="50px" height="50px" />
<h5>{$node->menutext}</h5></a>

{/foreach}

Is this along the right ideas? Thanks for all your help Im trying to learn this!
Post Reply

Return to “Layout and Design (CSS & HTML)”