The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.current for a page _and_ its subpages
#1
Hi, Smile
I'm discovering GetSimple, and I think I have now found my favorite CMS (really).
But there is something I don't know how to do. :/

I've created a website with pages and subpages. On the navigation, called with get_navigation(return_page_slug()); there are only some pages, but not any subpages. What I want to do is to have a "current" class on the <li> corresponding to a page, even if the viewer is currently on a subpage of this page.

For example, when I am on 'foo/bar', I would like to have the 'foo' button (<li class="foo">) with the class "current" (so, <li class="current foo">), exactly like if I was actually on the page 'foo', and not on the page 'bar', subpage of 'foo'.

Is there a (simple) solution ? Smile I'm not searching for a multi-lever navigation (I found this tutorial), but for the same default simple navigation, with a consideration of subpages.

Thanks a lot Wink
Nicolas.
Reply
#2
As soon as you’re not happy with the way the menu is generated you’ll have to code your own menu function (most of the time). For this you might find zegnat_menu_function() a good starter.

If you want to see how far you can get editing the standard function you’ll find it in /admin/inc/theme_functions.php. It starts at a line somewhere around 290. You’ll want to edit this line:
Code:
if ("$currentpage" == "$url_nav") { $classes = "current ". $url_nav; } else { $classes = $url_nav; }

Good luck there, I don’t have the time to write you a custom function just now.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply




Users browsing this thread: 2 Guest(s)