Page 1 of 1

Setting variables for Global content blocks in module

Posted: Mon Dec 21, 2009 7:25 pm
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

Re: Setting variables for Global content blocks in module

Posted: Mon Dec 21, 2009 8:27 pm
by Dr.CSS
How is it supposed to modify it's display and why?...

Re: Setting variables for Global content blocks in module

Posted: Mon Dec 21, 2009 9:22 pm
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>