From: Philip T. <ph...@tr...> - 2011-03-02 17:06:10
|
hi, i am trying to get semantic mediawiki's result format template to generate alternating row colors (white and grey) with CSS. http://www.episodewiki.com/House -> section "recent episodes" edit link: http://www.episodewiki.com/index.php?title=House&action=edit§ion=5 currently i am using the result format "template", and use metadata of the queried pages to generate different li classes. template url: http://www.episodewiki.com/index.php?title=Template:Recent_episodes&action=edit template code: " *<li class="ep{{{7}}}">*<div class="b1">{{{2}}}</div><div class="b2">{{{3}}}</div><div class="b3">[[{{{4}}}]]</div> <div class="b4">{{#if: {{{5}}} | <div class="trailer">[[{{{4}}}|Trailer]]</div> | }}</div> <div class="b5">{{{6}}}</div></li> " but that's such a dirty solution and is not applicable to other sections like "House News" , and i was hoping you guys can help me out. the question is: how do i get semantic mediawiki to output alternating li classes? result 1: <li class="even">... result 2: <li class="odd">... result 3: <li class="even">... ... i think the solution might be something along the lines of using parserfunctions in the template, but i don't know how. is it possible to initialize a counter while looping through the results? f.i. if result = 1 then even if result = 2 then odd if result= 3 then even... Thanks, Philip T. PS.: i don't want to use CCS pseudo-selectors because of compatibility issues. |