PDA

View Full Version : Okay, I Give Up. Using variables/template logic in my CMS Grid breaks grid output.


MetalFrog
09-29-2010, 08:33 AM
I'm trying to come up with a way to display certain content on the home page, that doesn't show up elsewhere in the CMS.

I found a tip on utilizing a hack to check if the nodeID is 1, and it works well. The problem is, I can't edit my Grid's HTML and put in a conditional to check it. When I put in a variable or an if statement, the grid stops parsing data.

<div id="doc3" class="yui-tvb-r3">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-g">
<vb:if condition="$vbulletin->nodeid == 1">
<div class="yui-g first">
<div class="yui-u first yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column1">$column[1]</ul>
</div>
<div class="yui-u yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column2">$column[2]</ul>
</div>
</div>
<vb:else />
<div class="yui-g">
<div class="yui-u first yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column3">$column[3]</ul>
</div>
<div class="yui-u yui-panel">
<ul class="list_no_decoration widget_list" id="widgetlist_column4">$column[4]</ul>
</div>
</div>
</vb:if>
</div>
</div>
</div>
<div class="yui-b yui-sidebar">
<ul class="list_no_decoration widget_list" id="widgetlist_column5">$column[5]</ul>
</div>
</div>
</div>

This code will output the following, instead of the parsed content from the columns...

$column[1]

$column[2]

$column[3]

$column[4]

$column[5]

I take out the if, and it works again. I put in {vb:raw vbulletin->nodeid} to see if it outputs the id, and it goes back to being broken.

Is what I'm trying to do just not possible?

Lynne
09-29-2010, 01:31 PM
It probably doesn't like that you are saying "if condition x, then show columns 1 and 2, else show columns 3 & 4". I think you mess stuff up if you only try to show some of them. (And what do you see in the layout editor with something like this?)

Perhaps you'd do better to put the condition around the widget templates themselves?