Sidebar to show for sub pages for each page? - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16) +--- Thread: Sidebar to show for sub pages for each page? (/showthread.php?tid=3282) |
Sidebar to show for sub pages for each page? - Fairly_New - 2012-06-18 Hello fellow GetSimpletons! I'm 100% new to GS. I'm currently putting together a website in GS using default Innovation theme. I've made my pages. But I want to know how I can utilize the sidebar area to display a list of sub pages according the page being viewed? Muchly appreciate your help! Thank You. Sidebar to show for sub pages for each page? - yurifanboy - 2012-06-18 This is slightly technical and will require basic knowledge of html and css. http://mvlcek.bplaced.net/get-simple/multi-level-navigation/ Install the I18N plugin and explore the possible combinations offered from the link. http://mvlcek.bplaced.net/multi-level-navigation/nav-children/ I would recommend using this function. A parent page will display all the child pages it is associated with in the sub menu. This may not display "a list of sub pages according the page being viewed" but rather according to which pages you have made children of the particular parent page. http://get-simple.info/extend/plugin/child-menu/40/ There is also the child menu plugin. I don't use this because usually the websites I do are in both English and Spanish, so I need multilingual features. Sidebar to show for sub pages for each page? - n00dles101 - 2012-06-18 Hi and welcome to the forums... Without having to install any plugins you could put the following function into your theme/functions.php file (create one if it doesn't exist) Code: function getSubMenu($page){ Then in your theme, put this in your sidebar: Code: <ul> Change $id to a specific page slug to get a specific subpages, otherwise it will create subpages for whatever page your on. Sidebar to show for sub pages for each page? - Fairly_New - 2012-06-19 Ah thank you very much! Sidebar to show for sub pages for each page? - Fairly_New - 2012-06-23 how do I get the parent of the subpages to show above the subpage list? example: /* sidebar.inc.php */ <h2><?php get_page() ?></h2> <ul> <?php getSubMenu($id); ?> </ul> what's the correct function to get parent of the subpages? I just made up get_page() as an example. And how do I organize the order in which they subpages appear on the list? Sidebar to show for sub pages for each page? - n00dles101 - 2012-06-25 @fairly_new, Code: function getSubMenu($page){ This will sort the submenu on Published Date (or more corectly last edited date) To get the field value of the current page use Code: //will echo the title of the current page Hope this helps.... Sidebar to show for sub pages for each page? - pierre - 2012-08-21 n00dles101 Wrote:Hi and welcome to the forums... This solution works to do what i want to accomplish, however it doesn't display the title of the page until it has been re-saved. Not a clue how this can be. Have you experienced this? Sidebar to show for sub pages for each page? - n00dles101 - 2012-08-21 what version of GS are you using? There was an issue with caching in early versions which is sorted from 3.1 onwards... Upgrade to 3.12 for the latest and greatest Sidebar to show for sub pages for each page? - pierre - 2012-08-21 n00dles101 Wrote:what version of GS are you using? I'm using 3.1 at the moment. Will try to make an update, however. Sidebar to show for sub pages for each page? - n00dles101 - 2012-08-21 Ah ok, I see whats wrong. I'm presuming that all the submenu pages also have the menu option set, if you want to output the 'title' of the page change the function to this: Code: function getSubMenu($page){ Sidebar to show for sub pages for each page? - pierre - 2012-08-21 n00dles101 Wrote:Ah ok, I see whats wrong. I'm presuming that all the submenu pages also have the menu option set, if you want to output the 'title' of the page change the function to this: Thank you! Sidebar to show for sub pages for each page? - Connie - 2012-08-22 we did it like this with the i18N-navigation at www.get-simple.de in the sidebar of template.php: Code: <?php it is explained here: http://www.get-simple.de/anwendung/gs-tipps-tricks/i18n-navigation-konditionale-anzeige-von-unterseiten-navigation/ and it shows a h2-header and the submenu only of there are sub-pages Sidebar to show for sub pages for each page? - mgilvey - 2012-08-29 So what you are saying is to get any of the sub pages I made I need to add all this code? I installed the I18N plugin which has taken over some of the default functions or they are just not working now. For example; I used to click a button to add keywords and description and set the page order if it's going in the menu. I can no longer get access to that. Now to put the pages in the order I want I need to do some drag n drop thing which only highlights the text and doesn't drag anything. Is there really no other way to get access to sub pages? Was GS designed thinking people would only have one level of navigation? Or do I just have to bite the bullet and jump into the code you provided? Sidebar to show for sub pages for each page? - uitdecom - 2012-10-03 Hello Can anyone tell me why this part of the above code isn't working? Code: $pagesSorted = subval_sort($children,'pubdate'); // select which field to sort on. Sidebar to show for sub pages for each page? - n00dles101 - 2012-10-03 try changing to this , looks like its should be pubDate instead. Code: $pagesSorted = subval_sort($children,'pubDate'); // select which field to sort on. Sidebar to show for sub pages for each page? - uitdecom - 2012-10-03 Yes, already tried that. Here's my full code: Code: function getChildPages($page){ Sidebar to show for sub pages for each page? - Connie - 2012-10-03 mgilvey Wrote:s there really no other way to get access to sub pages? Was GS designed thinking people would only have one level of navigation?< mgilvey, no, with that plugin GS works with many levels. Your problems must sit elsewhere, Cheers, Connie Sidebar to show for sub pages for each page? - Carlos - 2012-10-03 @uitdecom You'll have to use or do something different to sort by pubDate -- it is not stored as "2012/12/31 ..." or something directly sortable like that, but as textual English ("Mon, 31 Dec 2012 ..."). Sidebar to show for sub pages for each page? - uitdecom - 2012-10-03 Thank you both for the quick replies. I changed the child_menu plugin for my purposes. RE: Sidebar to show for sub pages for each page? - RHJ - 2012-12-16 Thanks for many good ideas! Here's my own attempt to make submenues: Code: <?php |