• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [SOLVED]Using {$position} to load correct images
PostPosted: Thu Jun 28, 2012 7:21 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Oct 09, 2010 10:23 am
Posts: 145
Location: Finland
Hi,

Is there better way to this? I have three level navigation, where second level is only section headers and third level is sub-navigation. I want to load different images to banner dependign on the second level.

Like this:
Code:
{if $position eq "2.1.1" || $position eq "2.1.2" $position eq.....}
load image1
{elseif $position eq "2.2.1" || $position eq "2.2.2" $position eq.....}
load image2
{elseif $position eq "2.3.1" || $position eq "2.3.2" $position eq.....}
load image3
{/if}


-R


Last edited by Recon on Mon Jul 02, 2012 12:56 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Using {$position} to load correct images
PostPosted: Sun Jul 01, 2012 12:58 am 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 11821
Location: Arizona
Maybe a bit more detail in what you are trying to do would help?...

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get its parameters.
Right click and view source is a great way to see what you have to work with.
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image


Top
 Profile  
 
 Post subject: Re: Using {$position} to load correct images
PostPosted: Sun Jul 01, 2012 7:06 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Oct 09, 2010 10:23 am
Posts: 145
Location: Finland
I'll try :)

I need to get menu parent detail somehow and only variable for that what I have found is {$position}. I want to load different picture for every level2's "group" (every level 3 pages on that menu parent) like this:

three level navigation:

*level 1
**level2.1
***level3.1.1 (image1)
***level3.1.2 (image1)
***level3.1.3 (image1)
**level2.2
***level3.2.1 (image2)
***level3.2.2 (image2)
***level3.2.3 (image2)
**level2.3
***level3.3.1 (image3)
***level3.3.2 (image3)
***level3.3.3 (image3)


I could do this with examble what I show, but if -statement would be sooooooo long and I don't know numbers of the pages on level three.

-R


Top
 Profile  
 
 Post subject: Re: Using {$position} to load correct images
PostPosted: Sun Jul 01, 2012 5:14 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 11821
Location: Arizona
This is something I would do in the style sheet using the parent page alias, the CGSimpleSmarty module...

<body class='{$cgsimple->get_parent_alias()}'>

.level2.1alias div#banner {background: url(uploads/images/image.jpg)}

.level2.2alias div#banner {background: url(uploads/images/different_image.jpg)}

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get its parameters.
Right click and view source is a great way to see what you have to work with.
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image


Top
 Profile  
 
 Post subject: Re: Using {$position} to load correct images
PostPosted: Mon Jul 02, 2012 12:55 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Oct 09, 2010 10:23 am
Posts: 145
Location: Finland
Thank You,

works like I wanted. I haven't known that CGSimpleSmarty works like that, perfect.

-R


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner