We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    ok - I have a menu [restauant menu] with about 25 items on it, the designer has cleverly :@ alternated the titles in four different colors i.e.

    item 1 == pink,
    item 1 == orange,
    item 1 == blue,
    item 1 == green,
    item 1 == pink... and so on

    ... so I grab all the menu resources with get resources, but I have got no idea how to setup the &tpl=`menuPageTpl`template to change the item classes as in the above example....

    any thoughts?

    -thanks
    -sean
      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
      • 3109 ☆ A M B ☆
      • 894 Posts
      You can do this with css here’s an example that might help.

      http://css-tricks.com/5452-how-nth-child-works/

      Good Luck.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 26503
        • 620 Posts
        hmmmmm.. no support for IE8. can’t use that method. [nor do I want to use jQuery for styling]
          *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

          Sean Kimball CLP, CLS.
          Technical Director / Sr. Developer | BigBlock Studios
          ._______________________________________________.
          Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
          27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
          phone/fax: 905-426-5525
          • 26503
          • 620 Posts
          I wound up doing this:

          snippet call:
          [[!nthItem? &index=`[[+idx]]` ]] <!--[[+idx]] -->


          the snippet:
          <?php
          
          	if(!$index){
          		return false;
          	}else{
          		$rule == 'first';
          		
          		$indecies = array(2,6,10,14,18,22,26,30,34,38);
          		if (in_array($index, $indecies)) {$rule = 'second' . $index;}
          		
          		$indecies = array(3,7,11,15,19,23,27,31,35,39,43);
          		if (in_array($index, $indecies)) {$rule = 'third' . $index;}
          		
          		$indecies = array(4,8,12,16,20,24,28,32,36,40);
          		if (in_array($index, $indecies)) {$rule = 'fourth' . $index;}
          			
          		return $rule;
          	}


          Though there must be a cleaner way to calculate the $indecies number other than putting it in an array

          -sean
            *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

            Sean Kimball CLP, CLS.
            Technical Director / Sr. Developer | BigBlock Studios
            ._______________________________________________.
            Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
            27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
            phone/fax: 905-426-5525