Im attempting to create zebra stripes for a page I recently created. The page basically spits out X number of nodes of 'flexinode-1' type.
I have the page up and running fine, and I can style each element with no problems. My question now is, how can I add the Zebra Striping element to this page?
Each of my nodes is visually seperated by the border-bottom: solid 1px #000; css style.
My flexinode-1.tpl.php file is extremely small...the entire code is this:
<div class="class-name-used-for-styling">
<?php print ($main ? strip_tags($content, '<a><p><br><br />') : $content) ?>
</div>
I've read about adding :
<?php
function _phptemplate_variables($hook, $vars) {
static $count;
$count = is_array($count) ? $count : array();
$count[$hook] = is_int($count[$hook]) ? $count[$hook] : 1;
$vars['zebra'] = ($count[$hook] % 2) ?'odd' : 'even';
$vars['seqid'] = $count[$hook]++;
return $vars;
}
?>
into my pages, but I'm not exactly sure where I should be adding this, or if I have to specify the flexinode type anywhere.
All help is appreciated. Thanks,
-=Vince
Comments
zebra
is it really that easy?
I'll give this a shot and let you know.
Where can I find the
or styles associated with $zebra so I can define what colors I'd like to set?
Thanks very much,
-=Vince
do i need the other code?
Will I need to use the larger block of code that I posted in the original forum post? Or can I just add that reference to $zebra?
Technology White Papers
Zebra striping support is
Zebra striping support is part of phptemplate engine.
So the CSS class added is either 'odd' or 'even'.
--
Drupal consultancy
--
Ixis (UK): Drupal support, Drupal hosting.
what class is this within?
Thank you for this, I appreciate it. Within what class should I declare the 'odd' and 'even' sub classes within?
Technology White Papers
Up and running...
Got this running properly. I really appreciate the help
Technology White Papers
Got this running properly. I
uh, how? would be nice to know ;)
did you end up having to include that function in template.php, or not? i've got a similar problem here: http://drupal.org/node/97879 - perhaps you might have an insight in to what i need to do?
JESUS!
Wow! I did NOT know it was that easy! Stripey websites, here I come!