Selected with varying urls
Posted: 08 June 2007 10:19 AM   [ Ignore ]
Newbie
Rank
Total Posts:  3
Joined  2007-03-01

Hey -

I am using Selected plugin with a current version of EE.  I have structured a site with urls such as:
http://domain.com/site/about/
http://domain.com/site/about/
http://domain.com/news/
http://domain.com/events/

And the selected function only works on the links without the site segment.  Is there any way to have it choose the “end” segment?  Thoughts?  Thanks!

Profile
 
 
Posted: 08 June 2007 10:39 AM   [ Ignore ]   [ # 1 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  336
Joined  2005-07-09

Kathy, I’m not sure I follow. Can you post some code? Do you mean the position of the relevant url_segment changes from URL to URL?

 Signature 

Ingmar Greil

Profile
 
 
Posted: 08 June 2007 02:09 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  3
Joined  2007-03-01

Here is my navigation.  Some are set up as blogs like news and events but other pages are in a template group called “site” . 

<!-- top navigation -->
{exp:selected item="{segment_1}" replace="class='active'"}
            
<ul id="nav">
                <
li class="about"><a href="http://ritamcgrath.com/site/about/" {selected_about}>about</a></li>
                <
li class="blog"><a href="http://ritamcgrath.com/blog/" {selected_blog}>blog</a></li>
                <
li class="news"><a href="http://ritamcgrath.com/news/" {selected_news}>news</a></li>
                <
li class="events"><a href="http://ritamcgrath.com/events/" {selected_events}>events</a></li>
                <
li class="speaking"><a href="http://ritamcgrath.com/site/speaking/" {selected_speaking}>speaking</a></li>
                <
li class="consulting"><a href="http://ritamcgrath.com/site/consulting/" {selected_consulting}>consulting</a></li>
            </
ul{/exp:selected}
            
<a href="http://ritamcgrath.com/" class="home">home</a>

So it “sticks” on the news and events but in the site group, the navigation doesn’t stick to it.  I hope I am making sense haha.

Profile
 
 
Posted: 10 June 2007 01:38 PM   [ Ignore ]   [ # 3 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  336
Joined  2005-07-09

I see what your problem is, but I am afraid there is currently no other solution than to structure your content in a way that the url_segment does not change.

 Signature 

Ingmar Greil

Profile
 
 
Posted: 10 June 2007 01:56 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  3
Joined  2007-03-01

Terrific.  I wish I would have known that beforehand.  Ugh.  Thanks.

Profile