Menu PHP block
This is a simple PHP block taken from the main Template Blocks website. A good feature is that is automatically defines the selected tab based on the URL the visitor is viewing:
<?php $links = array( 'Home' => '/', 'Features' => '/features.html', 'Demo' => '/demo.html', 'Download' => '/download.html', 'Support' => '/support/', 'About' => '/about.html' ); echo ' <ul id="toplinks">'; foreach( $links as $key => $value ){ $selected = ($_SERVER['REQUEST_URI'] == $value) ? ' class="selected"' : ''; echo '<li><a href="' . $value . '"' . $selected . '><span>' . $key . '</span></a></li>'; } echo ' </ul>'; ?>
Just replace the array at the top the with your URL list and menu titles. You might also need to make some modifications in the markup that is generated…
July 7th, 2009 at 8:12 pm
hello,
is it possible to make sub-menus ?
tank you.
greedings
July 8th, 2009 at 1:33 pm
Yes, of course - It’s all up to you, and the sections you create and the admin interface.
Although (I believe) in the current version only one level of children in supported…
This is just plain PHP code you can manipulate to show the menu as you want it.