I am in need of help in creating a side navigation bar in SilverStripe that would look somewhat similar to the one on this page: http://www.bgcg.org/index.php?PID=1&cid=1.
so the goal is to have the top menu show like this
Â
red - home
green - about us
blue - contact
red - news
green - product
.
.
.
(continuing down, alternating red, green, and blue icons)
we have this function (based on the one here:
http://silverstripe.org/template-questions/show/265003?start=0):
which basically gets us the data that we want into a variable.
Â
public function MyMenu(){
  $items = $this->Menu(1);
  $numItems = $items->Count();
  $rows = array();
  $it = $items->getIterator();
Â
  for($i = 0; $i < $numItems; ++$i){
      $row = new DataObjectSet();
      $num = $it->key();
      switch($num%3) {
            case 0:
                  $classColor = "spinner_red";
            break;
            case 1:
                  $classColor = "spinner_green";
            break;
            case 2:
                  $classColor = "spinner_blue";
           break;
      }
Â
      $row->push($it->current(), $it->key());
      $it->next();
Â
      $rows[] = array('Row' => $row, 'Color' => $classColor);
  }
Â
  return new DataObjectSet($rows);
    Â
}
Â
and in our template we have
<% control MyMenu() %>
  <% control Row %>
      <tr>
            <td><a href="$Link" class="$Color">$MenuTitle</a><br/></td>
      </tr>
 <% end_control %>
<% end_control %>
I already have the classes set up in the CSS. The problem is that I need to somehow get access to that $Color variable in the php script in the template. How would I do that?