Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sub-Navigation Menu
#2
That piece of code is specifically to display child elements of a certain page. The first line could be called the selector, as you can see it is only grabbing pages which have the parent set to $a.

If you are just feeding the current page slug into $a it will not work on a subpage, this is because there are no pages that have the subpage as parent. If you want to use this code snippet you’ll want to make some sort of check like:
  • If this page has no parent, put this page’s slug in $a.
  • If this page has a parent, put this page’s parent’s slug in $a.
I hope you get the gist of it.
“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


Messages In This Thread
Sub-Navigation Menu - by dclawson - 2010-02-18, 12:44:19
Sub-Navigation Menu - by Zegnåt - 2010-02-18, 23:42:37
Sub-Navigation Menu - by dclawson - 2010-02-19, 15:48:53
Sub-Navigation Menu - by caviar - 2010-04-07, 19:46:44
Sub-Navigation Menu - by dclawson - 2010-04-07, 23:30:32
Sub-Navigation Menu - by caviar - 2010-04-08, 23:04:38
Sub-Navigation Menu - by dclawson - 2010-04-26, 20:45:18
Sub-Navigation Menu - by Zegnåt - 2010-04-27, 17:02:13
Sub-Navigation Menu - by RobA - 2010-10-14, 06:08:16
Sub-Navigation Menu - by RobA - 2010-10-15, 06:14:06
Sub-Navigation Menu - by Zegnåt - 2010-10-15, 06:40:35
Sub-Navigation Menu - by RobA - 2010-10-15, 07:10:38
Sub-Navigation Menu - by ccagle8 - 2010-10-15, 10:06:07



Users browsing this thread: 1 Guest(s)