Setting variables for Global content blocks in module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
tripp
Forum Members
Forum Members
Posts: 10
Joined: Thu Dec 03, 2009 11:23 pm

Setting variables for Global content blocks in module

Post by tripp »

Here's another question that I can't seem to find an answer to...

I have a route setup and I need my action to grab a parameter and then put the value of that param into a smarty variable that a global content block can examine and modify its display accordingly. I thought this would be really straight-forward as I've done this with templates/action setting title and meta description tags. However, the GCB doesn't seem to be aware of the variable I'm setting in my action via $this->smarty->assign('foo', 'bar'). I even tried {assign var='foo' value='bar'} in my template which includes the GCB and this doesn't work either. How can I go about doing this? Seems that there's gotta be a way.

Cheers,

Tripp
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Setting variables for Global content blocks in module

Post by Dr.CSS »

How is it supposed to modify it's display and why?...
tripp
Forum Members
Forum Members
Posts: 10
Joined: Thu Dec 03, 2009 11:23 pm

Re: Setting variables for Global content blocks in module

Post by tripp »

basically, the GCB has series of tabs in it and I need to know which tab to highlight based on some parameter information passed in the URL.

here's the content:

Code: Select all

<div id="header">
<h1 class="logo"><a href="/">MySite</a></h1>
{cms_module module='ListingSearch' action='quicksearch'}    
<ul class="nav">
<li><a class="home" href="/">Home</a></li>
<li {if ($myvar == 'rental')}class="active"{/if}><a class="rentals" href="advanced-search">Rentals</a></li>
<li {if ($myvar  == "real-estate")}class="active"{/if}><a class="real-estate" href="advanced-search">Real Estate</a></li>
</ul>
</div>
Post Reply

Return to “Modules/Add-Ons”