Welcome to the archive of the old FlatPress support forum. Browse more than a decade of FlatPress wisdom! Login is disabled.

The current FlatPress support forum is available here: forum.flatpress.org
horizontal top menu - how to mark the active (static) page?
  • Hi all, i am trying to set up a simple CMS like theme, based on Deckay 3.0 by Zeuder. Using the horizontal menu in the top bar for static pages, i would like to hilight the currently viewed page in the menu to improve the navigation for the user. How can i do this? Daniel
  • I have made a theme with a top bar, but i started from leggero style. in this discussion there are some istructions, but is in italian language... if you don't undrestand anyting, i try to help you... i hope... :D update: link sorry... :P
  • @lantaca: is there a link for that discussion? at the moment im trying to get it running like it is shown on http://dkdenz.de/index.html I was able to add pagename, but css for #pagename #pagename_menu doesnt work...
  • I saw Deckay 3.0. It's great! I think that horizonal menu uses the widget of menubar. So, add the menu-bar widget and below codes in your theme. This code incomplete, sorry. add below in theme.conf.php . register_widgetset('menubar'); add below in header.tpl. add below in style.css. /*== MENU ==*/ #menu { background: #a00; height: 40px; margin: 0; padding: 0; text-align: left; width: 700px; } #menu ul{ margin: 0; padding: 0; list-style: none;} #menu li{ display: inline;} #menu li a:link, #menu li a:visited, #menu a:active{ display: block !important; display: inline; /* ie6 fix margin*/ float: left; color: #FEFEFE; font-size: 1.0em; margin: 0 16px; padding: 10px; text-decoration: none; } #menu li a:hover{ color: #fff;background: #aaa;} And add the widget on 'menubar'. i.e. 'BlockParser:menu' . you will see menu-bar on your blog top side.
  • @Nakamachidai: i already have the menu bar... Included in the menu bar are links to static pages, and the blog itself: Start, Blog, Profile, About, Contact In Deckay, there is a 1px line below the Menu Item where the mouse is (hover). This "mark" disappears after clicking the menu item. I want this line to stay below the selected item to indicate in the menu, which according page is shown. Usage of "active" does not work, because "active" is defined as the "time between click & release of the mouse button"... Any ideas? Anyone?
  • you can't do that with widgets, because blockparser widgets can't be aware of such things as current page. You can create a custom widget such as "adminarea" and make it output a custom class such as 'current-page' on the link you want to be highlighted. such a class would be output by checking against the global variable $fp_params['page'] if you want to see if you're on some page or $fp_params['category'] if you want to check for a given category id. e.g. function mywidget() { global $fp_params; if (isset($fp_params['page']) && $fp_params['page'] == 'about') $out = 'my link'; else $out = 'my link'; return array('subject' => 'my cool widget', 'content' => $out); } you can also hardcode a topbar in your theme and use conditional statements such as my link right in your tpl. search the forum there should be some example HTH
This discussion has been closed.
All Discussions
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion