The MU forums have moved to WordPress.org

1 2 3

Editing and creating top level navigation menus (66 posts)

  1. dizzy99
    Member
    Posted 17 years ago #

    Well i have MU Wordpress up and running and have added a few hacks, plugins etc and I must say i'm very very pleased with it and its functioning well and far better than i expected.

    One thing i have need of is control of top navigation menus and this is likely down to my severe lack of knowledge of Wordpress than Wordpress MU (i'm new to both systems).

    The theme I'm using uses some tabs at the top, created from top level pages. I think the routine is defined in wp_list_pages and that's fine and works as it should. New pages get a new tab and away we go.

    However some pages i want to define shouldn't get a new tab and it would really be handy to add extra menu tabs for say a category etc. How can this be done through the wordpress admin interface ? Is there a plugin for such things or an option I'm simply missing ?

    At the moment if i create say a Terms Of Use page it will display a Terms of Use tab which isn't required. I think i and very likely my members will require greater flexibility on what does and doesn't become a menu item.

    Anyone any advice on how they deal with this or what plugin, if they use one, is available to allow myself and my members greater flexibility over our menus ?

    Any help appreciated.

  2. andrea_r
    Moderator
    Posted 17 years ago #

  3. dizzy99
    Member
    Posted 17 years ago #

    Sorry i think you misunderstand me here, i don't want my users, or myself, to customise the admin menu panels but the top level page menu items within their themes.

    On my webpage at http://nptgroups.co.uk/ you'll see a number of tabs for pages, these include home, about, features etc. These are auto created using the wp_list_pages function (i assume) within the theme and i see the practice a lot on other themes too. If i create a top level page then it gets a menu item but sometimes i don't want my top level pages to get a menu item here but require i link it in the website page of my choice.

    So if i create a Terms Of Service page it will automatically create a TAB for that on this theme (and any others that use this practice). However my Terms Of Service link should be within my footer somewhere and not on the tabs at the top.

    I know its likely possibly to hard code all the tabs within the theme but this draws a problem to my users who would be using similar themes as they cannot do the same practice, not having direct editing rights to the themes.

    So my question is is there no way to define that a page shouldn't be listed in the wp_list_pages function, maybe using a plugin or widget etc ? It seems so fundemntal to other platforms and i just can't seem to jump over this small, but rather annoying hurdle.

    Any help appreciated.

  4. lunabyte
    Member
    Posted 17 years ago #

  5. dizzy99
    Member
    Posted 17 years ago #

    Mmmm again this shows only how to hard edit to stop pages showing in wp_list_pages function, which of course, as admin with access to theme templates, i can happily do.

    However how could a user of our system do the same without direct editing of the theme files ?

    And instead of putting up links, help would be better. I thought the forums were a transit to discuss subjects.

  6. azventurecapital
    Member
    Posted 17 years ago #

    the only thing I can think of quick and dirty for the users would be to hack the ROLES plugin and set a predetermined number of pages for the themes you make available, then allow users to "edit" the specific number of pages, but not add more than the maximum number you have alloted. If they didn't need all 5 (let's say), they could just leave the Title line blank in that page, or maybe delete it.

  7. andrea_r
    Moderator
    Posted 17 years ago #

    "So my question is is there no way to define that a page shouldn't be listed in the wp_list_pages function, maybe using a plugin or widget etc ?"

    Nope. Changing what gets listed when the pages are spewed out is listed in one of the links lunabyte mentioned above. but, you can't tell one Page to appear somewhere else in the them theme layout without hard-coding it in there.

    (And some of us fly by here pretty fast and only have time to plunk a quick link to point you in the right direction, instead of a fully featured tutorial.)

  8. lunabyte
    Member
    Posted 17 years ago #

    "(And some of us fly by here pretty fast and only have time to plunk a quick link to point you in the right direction, instead of a fully featured tutorial.)"

    Unless you're spewing useless bull**** spam shams.

    Seriously though, you 'could' write your own page function, which would be similar to the existing one, and then use the special fields area in the post box for the page, to add a couple of tags to it. like tab_display (value of true/1), and tab_order (value of #, which would be the order).

    Other than that, you're talking about a full blown menu management plugin.

    Hmmm... gives me an idea.

  9. dizzy99
    Member
    Posted 17 years ago #

    Thanks guys, i appreciate the more indepth answers.

    I've been looking and looking for a plugin to fulfil this but hadn't come across one and as plugins are fragmented all over the Internet (instead of one central place) i really wasn't sure if i was missing something.

    The approach with the special fields area could likely work but would be rather confusing for a user set that, frankly, knows little to nothing about html or websites. If it was an easy menu hierarchy it would be quite simple for them to do that.

    I recently put on the category visibility that functions some way within the idea i had for the pages menu view. Granted its not the same but allows members to not show certain categories on the front page, thus grabbing data before output in the loop. This seems to work very well and if the same practice could be done with page output navigation it would certainly give more flexible blog navigation layout.

    I'll keep looking as their may still yet be a plugin out there for this. If i find anything, i'll report back.

    As for flying in and not having the time to write a tutorial i fully understand. However i only posted here when i had sourced all reasonable ways to work the problem myself and the links, frankly didn't help. MY PHP coding skills are ok (for modyfing simple code) but don't get me too far so rolling my own isn't really an option at this point.

    However i do fully understand, being an admin of several websites myself, that time constraints sometimes mean an indepth reply isn't as easy as it could or should be.

    Thanks for the help guys

  10. andrea_r
    Moderator
    Posted 17 years ago #

    Actually, my husband wrote a navigation bar plugin, but I'm not sure if he released it.
    It enables through an admin area to specify what you want to show on the nav bar of the blog's theme.
    (See, this is where you got me confused... :D There's nav bars and menus everywhere.)

    He's made it so you can pick some or all Pages (I think) and certain categories. It's been a while since I used it myself, and I know for sure you'd have to modify themes to include it.

  11. lunabyte
    Member
    Posted 17 years ago #

    @Andrea

    Not if it was a plugin/widget combo. ;)

    I too have code laying around for something like this that I wrote for a portal system. It wouldn't take "too" much to flip it around.

    Granted, now that my mini-vacation is at an end, I'd have to work on it during the evenings.

  12. andrea_r
    Moderator
    Posted 17 years ago #

    Ooooo widgetizing it.. that would rock. :D Now to figure out how to have 36 hour days.

  13. corourke
    Member
    Posted 17 years ago #

    Screw 36 hour days. I want to be able to put my newborn in stasis for a nice relaxing 12 hour nap and then wake him back up.

    I agree about plugins being all over the place (and typically the more desired the existing plugin the more hidden it is such as the blog by email plugin by that bike guy). Happily it seems that wpmudev.org seems to be getting more plugins, tracking down all of the various tweaks and fixes to plugins is a pain.

    Is your hubby going to add that plugin to the dev site Andrea?

  14. andrea_r
    Moderator
    Posted 17 years ago #

    He'll probably delegate that to me. :D

    (I haven't figured out the stasis for kids yet, but it would also come in handy during the teen years.)

  15. dizzy99
    Member
    Posted 17 years ago #

    This sounds fantastic and would really help. Thanks for that and yes, sorry i didn't get the terminology right :) I'm only days into wordpress so its all rather new to me, but i do know other CMS type systems so its not altogether a culture shock.

    A widget combination would certainly be good.

    If your up for a spot of coding, then an option to define additional links as well as removing default ones from the loop would make it perfect.

    Obviously this would need a new theme subroutine to be implemented but thats no big deal, i'm modyfing themes anyway, getting them fully XHTML 1.0 transitional, again its amazing how many fail validation for the simplest of things.

    I am, in honesty, amazed how some things like this, which for a CMS (yes i know a blog isn't strictly a CMS but is as good as one) has been missed. I guess people just hard code them into their blogs which, for a single user isn't a massive headache. But for MU a plugin like would make a huge difference to members who cannot modify code.

    Thanks again guys for helping and joining in on this. Its appreciated and what makes a good forum, great.

  16. andrea_r
    Moderator
    Posted 17 years ago #

    "I am, in honesty, amazed how some things like this, which for a CMS (yes i know a blog isn't strictly a CMS but is as good as one) has been missed. I guess people just hard code them into their blogs which, for a single user isn't a massive headache. But for MU a plugin like would make a huge difference to members who cannot modify code."

    But MU really hasn't been out there and in massive use for very long, so that's part of the reason why. It's baby-new in thsoe terms.

  17. lunabyte
    Member
    Posted 17 years ago #

    Hmmm... Guess I got something to do this weekend now.

  18. dizzy99
    Member
    Posted 17 years ago #

    Andrea - Oh i didn't realise that :) I assumed it had been around a few years :) The code is tight and works very well so thats what lead to my assumptions :) Theres some bugs, sure, but for the most part it functions very well indeed and i'm very impressed.

    Lunabyte. Oh wow, looking forward to it :) I can supply coffee, beer, munchies and beta testing if you provide the code ? :)

  19. lunabyte
    Member
    Posted 17 years ago #

    It shouldn't take me much to convert my original script to work within WP and MU, but it's probably more useful for MU than WP.

    The original works off it's own table, but since MU already has plenty, I'll probably stick it in wp_x_options and use get settings to retrieve. Probably a control page in the backend, and then a widget with a title option, and then "maybe" an option for setting the class you want, or using the default for pages so they can have an active/inactive state.

    We'll see.

  20. andrea_r
    Moderator
    Posted 17 years ago #

    luna, if you need any of our code, lemme know and I'll email it to you (after I get a place to email it to. :) )

  21. lunabyte
    Member
    Posted 17 years ago #

    OK. I'll see what gives. It shouldn't be "too" difficult to look at what I've got and piece it together in a plugin/widget.

    Only question for it will be how "fancy" I want to get with it. Like drag and drop, and order switching.

    Might do a split screen instead, with a list of all available below the list of what's on the list. But, I could see that being one VERY long list if I included posts on it.

    Probably just going to be a list of pages, a list of categories, and a custom option where you paste the link in and give it a title.

    Even though, now that I think about it, someone "could" use the links feature to build their own menu. So, instead, I might just go that route and pull up links for a category designated in the widget. Then maybe make a quick plugin that can be called with a template tag too.

    Why reinvent the wheel, you know?

    Any initial ideas would be nice. I'd hate to code it twice.

  22. dizzy99
    Member
    Posted 17 years ago #

    Certainly sounds great either way.

    Adding your own links allows full flexibility and would certainly be a great start.

    If you could make it like the widgets, using Ajax, that would be awesome. So users could visually move things around. However its not to hard to put a weight to already established links so the following would apply.

    home -12
    my second page -10
    My first page -11

    So the resulting page links output would be

    home -12
    my first page -11
    my second page -10

    The -number or +number (i.e., 10) being the weight of the page in the link. This is the method Drupal employs and it works very well indeed.

    However Ajax visually would be better and is employed in the widgets system already, making for a more uniform approach.

    Implementing all this into one plugin however, thats the art i guess :)

  23. lunabyte
    Member
    Posted 17 years ago #

    I was considering using the same scale/approach as pages already use. Basically you set the order, in order. 0-10, or 0-(how ever many items you have).

    I'm fiddling with this a bit while waiting on a client response, and here's what I have so far, big picture. It "kind of" mirrors the way links are set up, but I'm taking out the fluff of relationship values, and rss stuff. IMHO, for a simple menu within your own site it isn't really needed.

    1) Adds new top level tab.

    2) Adds sub-tabs (links, whatever you want to call them) for adding a new item, and overall options. The main display will show the current menu, with edit/delete links.

    I'm still wrangling with whether or not to load the entire menu into an option in the options table, or going an additional route. Probably will be the first, most likely.

    It won't be overly complex, but really something pretty simple. Add a link to whatever it is you want to link to in the menu, give it a name, set the order, and you're done. This way it works the same for internal or external links, etc.

    I'll probably add 2 display related options. Either via a template tag, for top level tab-style menu's or use in a sidebar, then of course as a widget.

    I'm sure it will expand itself down the road, but initially I'm targeting something that simply works.

  24. dizzy99
    Member
    Posted 17 years ago #

    Sounds great and yes, keeping it simple really is what's needed.

    Most people signing for blogs on MU system will be inexperianced members of the web publishing world looking to get their information out as quickly as possible with little to know technical no how.

    After all, if they wasn't, they'd likely host their own wordpress somewhere (for the most part).

    So yes keeping it as straightforward and as simple as possible is certainly the way forward.

    Sounds Great.

    For the template tag i assume you would keep with the same output as the wp_list_page () ? Basically something like

    <li>this link</li>
    <li>another link</li>

    etc. Then to implement it would be a simple function replace with the default wp_list_page () to your function template call. This keeps themes working perfectly and adds the flexibility of moving, editing and changing those top nav bars.

  25. lunabyte
    Member
    Posted 17 years ago #

    For the output, yes I have it planned as output as list items. I haven't mapped out or thought about sub-menu items yet, as that can get pretty messy. Initially, I don't think I'll mess with it. Once it's working, we'll see.

    Back to output, it will be similar to list pages, yes. The default class(es) will be the same, or you can set your own for the list item.

    For the widget portion, you can set an id/class for the ul tag as well.

    So, the output will spit out:

    <ul id="x" class="x">
    <li class="xx x">first link</li>
    <li class="xx">second link</li>
    </ul>

    This is both for the widget, or the template tag. Essentially a set it and forget it thing, as far as a template tag.

    Any control can be handled through css. Most likely, most themes already have some sort of class for lists, so it shouldn't be too big of an issue.

    I'll be tinkering with it again later this afternoon, and if I get a break between now and then.

    I've (so far) got a working addition form, display-wise. I mixed up some of the link addition form, and the page addition form. Should seem familiar to users anyway.

    The standard name, link, and description fields on the left, with an on/off setting and order box on the right.

    I'm also considering the possibility of multiple menu's. So one could have a main tabbed menu up top, and one in the side (for example, or wherever).

  26. dizzy99
    Member
    Posted 17 years ago #

    Sounds excellent :)

    Sub pages could, at this stage, just be manually added i feel. Better then trying to run before you can walk :)

  27. lunabyte
    Member
    Posted 17 years ago #

    The only true issue I see with sub-pages, would be a top navigation menu.

    In the sidebar it wouldn't be an issue.

    So it would either take two tags, or a parameter passed to the function through the tag.

    I'll think about it.

  28. lunabyte
    Member
    Posted 17 years ago #

    ** Still need a mod to drop the spammy post way up there. As a reminder.

    +1 vote for adding Andrea as a mod. :D

  29. andrea_r
    Moderator
    Posted 17 years ago #

    No idea where dr mike is these days, although I did see him around...

  30. lunabyte
    Member
    Posted 17 years ago #

    Probably buried under 1000 things like anyone else. :-\

1 2 3

About this Topic

  • Started 17 years ago by dizzy99
  • Latest reply from lunabyte