View Single Post
  #7  
Old 29th May 2010, 14:29
mike_p mike_p is offline
Senior Member
 
Join Date: Mar 2010
Location: Surrey, England
Posts: 140
Thanks: 9
Thanked 28 Times in 17 Posts
Default

I've come back to this becuase I'd like a cleaner solution to styling these pages.

So I've edited each of the module.conf.php pages and added to each of the $items array a new field called "html_id"
eg within monitor/lib/module.conf.php for the raid_state menu item
Code:
$items[] = array( 'title' 	=> "Show RAID state",
         'target' 	=> 'content',
         'link'	=> 'monitor/show_data.php?type=raid_state',
	 'html_id' => 'raid_state');
then in my sidenav.tpl.htm I've changed the items loop to
Code:
 <tmpl_loop name="items">
    <li <tmpl_if name="html_id"> id='<tmpl_var name="html_id">' </tmpl_if>>
      <tmpl_if name="link">
        <a href="#" onClick="loadContent('<tmpl_var name='link'>')">
      </tmpl_if>
      <tmpl_var name="title">
      <tmpl_if name="link">
        </a>
      </tmpl_if>
    </li>
  </tmpl_loop>
In my css I can now assign an icon using (eg) #raid_state to select the item.

If anyone's interested (and Till and/or Falko agree!) I'd be happy to include these changes in svn.

Last edited by mike_p; 29th May 2010 at 14:34.
Reply With Quote