(embed a tag in another tag to… ) check if segment matches an entry title ?
Posted: 07 November 2008 07:49 AM   [ Ignore ]  
Summer Student
Total Posts:  10
Joined  10-16-2008

Hi,

I have a sidebar list where last 20 entries of a weblog are shown.
if the sidebar appears on the page of one of the entries in its list, I’d like to highlight this fact by trying something like:

{if segment_2 == {title}} style="background-color: yellow;"{/if}

(which doesn’t work.)

in other words… how can I use conditionals to check a segment against a… variable ?

Many thanks !

Profile
 
 
Posted: 07 November 2008 07:57 AM   [ Ignore ]   [ # 1 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10829
Joined  04-15-2006

Hi there,

Not knowing what your urls look like doesn’t help here but just wondering if perhaps you should be testing against the url_title instead?

Something like :

{if segment_2 == url_title}
<h2 class="my-class">{title}</h2>
{if:else}
<h2>{title}</h2>
{/if}

Hope that helps.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 07 November 2008 08:05 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  10
Joined  10-16-2008

Wow. I’m officially impressed !
(by both the speed and efficiency of your reply. that solved my problem. thanks !)

PS: how on earth does one get to fly helicopters for a hobby ?
(doozazzle !)

Profile
 
 
Posted: 07 November 2008 08:44 AM   [ Ignore ]   [ # 3 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10829
Joined  04-15-2006
octimizer - 07 November 2008 08:05 AM

Wow. I’m officially impressed !
(by both the speed and efficiency of your reply. that solved my problem. thanks !)

PS: how on earth does one get to fly helicopters for a hobby ?
(doozazzle !)

I promise I’ll try and post quicker next time though wink

Well I was bought a trial 1/2 lesson in a Jetranger by my wonderful Wife some years back and after that she saved up the money (without my knowledge - I think she must have stolen my kidney during the night and sold it or something wink ) for me to do my PPL(h). Whilst I was learning my Wife had a go and she was totally bitten by the bug and is now a commercial helicopter pilot working out of Coventry airport!

It’s really great to be able to go and land at places that normally you couldn’t even get to. We’ve seen some pretty impressive sites through what we are involved with in helicopters.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120376 Total Logged-in Users: 46
Total Topics: 126497 Total Anonymous Users: 28
Total Replies: 665218 Total Guests: 338
Total Posts: 791715    
Members ( View Memberlist )