![]() |
parentlist array Conditional styling
Hi there, i have a tabulated css layout that needs a class assigning it as selected, I want to define this selected class by the parentID, or of the parentList contains X
Code:
<if condition="$foruminfo[parentlist] == X">class="selected"</if> Code:
<if condition="in_array('X', array($parentlist))">class="selected"</if> Code:
<if condition="in_array(14,array($foruminfo[parentlist]))"> To answer my own question, $parentlist is a string not an array, so i need to explode this in to an array. However i can't do this inline as explode is not a valid php function for vb, instead i setup plugin. plug-in > Hook Location:parse_templates Code:
$parentarray= explode(',', $foruminfo[parentlist]); Code:
<if condition="in_array(14, $parentarray)">class="selected"</if> TA DA! Well i'm impressed anyway!:) |
All times are GMT. The time now is 08:36 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|