Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2009-02-04 05:49:57

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: [request] Bounty: Ultimate Nav Menu Builder

Hi Adi,

Thanks for checking this out.
I’m glad that you might look into showing the section hierarchy in the dropdown (for adi_menu).
I REALLY love your plugin – and it does 90% of what I need.

Some thoughts on your “devil’s advocate” questions (keeping in mind I don’t know how to make any of this work – so this is all purely conceptual)

isn’t the “dynamic” aspect of the proposed plugin going to disappear as soon as sections/articles are ordered beyond what can be done automatically by code (e.g: alphabetical order; sections first, articles last; random)? By nailing things down in a very specific & unique way, won’t you just end up with a fancy way of defining a handcoded Form to generate a menu?

My thought is that new sub-sections/articles get tacked on to the end of the menu using the usual sorting methods (e.g: alphabetical order; sections first, articles last; random). If you want to re-order or exclude them, then you have to go back to the “menu builder tab” and make the changes.

I know with adi_menu & cnk_section_tree users are forced to pay a visit the Admin tab to assign parents, but generally when new sections or articles are added the plugin takes them on board & no operator intervention is required.

I think my answer above explains my thought on this – anything new will show up after the “sorted” content.
If you want to sort or exclude it – you have to go back to the admin tab.

one other possible issue is that because you’re taking specific control of the menu output away from the tag and effectively giving it to an Admin tab then having multiple menus on a page would be problematic. Would you have multiple Admin tab for multiple menus?

I’m still thinking there would be a tag to create the menu. <txp:ult_menu /> for example.

With no attributes it would just create the menu you’ve defined in the admin tab.
With the addition of a section attribute you could restrict the output to just the menu items for that section.

That would allow you to use <txp:ult_menu /> for the main navigation – and something like
<txp:ult_menu section="products" /> to create a section specific menu in a sidebar.
(using the new tag parser you could just do <txp:ult_menu section='<txp:section />' />

I have NO IDEA if there are php/mysql/txp limitations that make some of these ideas impossible.

I’m just tossing ideas out there…

:)


Tom

Last edited by renobird (2009-02-04 05:50:45)

Offline

#17 2009-02-04 06:31:35

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: [request] Bounty: Ultimate Nav Menu Builder

I wish I had more time to work on this – it would be a top plugin to create.

renobird wrote:

My thought is that new sub-sections/articles get tacked on to the end of the menu using the usual sorting methods.

Fair enough, that would be the sensible “default” way of operation.

With no attributes it would just create the menu you’ve defined in the admin tab.
With the addition of a section attribute you could restrict the output to just the menu items for that section.

The thing that would really stuff it up would be where you wanted two different sort methods. For example, custom sort in the main menu and alpahabetical in the submenu.

Maybe you’d have to do something like:

<txp:ult_menu scheme="main" />
<txp:ult_menu scheme="sub" />

Where different menu schemes would have different Admin-side configurations.

Having said that, I haven’t had a requirement for such a scenario. Mind you, I never thought I’d need sub-menus. The very next client site after I did some requested adi_menu sub-menu enhancements … guess what!

Offline

#18 2009-02-04 06:44:15

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: [request] Bounty: Ultimate Nav Menu Builder

The thing that would really stuff it up would be where you wanted two different sort methods. For example, custom sort in the main menu and alpahabetical in the submenu.

Hmm. I guess I’d only envisioned this as a way to generate a “custom” sorted menu.

For simplicity maybe just a sort attribute?
Anything passed to it would override the custom order.

<txp:ult_menu sort="alpha" />

You sure you don’t have any spare time?

:)


Tom

Offline

#19 2009-02-04 17:02:45

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: [request] Bounty: Ultimate Nav Menu Builder

Information gathering:
These sortable demos might be helpful.

Offline

#20 2009-02-05 12:19:24

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: [request] Bounty: Ultimate Nav Menu Builder

To get things going I’m putting together some jQuery/php code for the interface (dragging/dropping/sorting). I’ll clean things up a bit and post the code this evening.

Offline

#21 2009-02-05 12:33:29

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: [request] Bounty: Ultimate Nav Menu Builder

Would you believe it? Look what has just dropped into the adi_menu forum.

Offline

#22 2009-02-07 02:51:47

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: [request] Bounty: Ultimate Nav Menu Builder

Hi guys,

I promised to post some proof-of-concept code of jQuery’s drag/drop/sorting functions. After some initial testing I decided to take it a step further to get some functionality I’ve been missing in TXP: easy and fast (as in drag-and-drop) navigation building for my clients. I don’t want them messing about in the pages. And I don’t want to spend time editing just 1 txp:section_list tag for an navigation update.

After some frantic coding today it turned into a complete plugin (actually my first ever plugin!) which allows building/sorting a section based navigation on the admin side and spits out the ordered sections on the public side with a tag. Editing/re-ordering of the navigation is very easy and quick.

It’s far from what has been discussed here and I’m not sure I’m the guy for the job to make the “ULTIMATE” Nav Menu Builder. But this plugin could be the starting point of something like that. I’m running into some issues. jQuery UI does not allow nesting of sortable lists natively….I’m researching jQuery plugins for this. Also I have no idea how to do subsections in textpattern….any help would be appreciated, I’m looking at the obvious TXP plugins to see how it’s done.

Anyway…here’s the plugin: jvh_navbuilder
Bear in mind that I threw this together just today and while I did do some testing, it’s considered unsafe for live sites at the moment, use it in a test environment ONLY!

This plugin requires the latest versions of jQuery and jQueryUI in your /textpattern folder.
Links are also included in the plugin info.

I’ll be cleaning up the code and doing some testing before officially releasing it in a couple of days. Any feedback is very much appreciated.

Last edited by jelle (2009-02-07 14:33:13)

Offline

#23 2009-02-07 04:22:44

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: [request] Bounty: Ultimate Nav Menu Builder

Hey jelle,

This looks like a great start! There are definitely some nested menu plugins out there – I’ll see what I can find.
Thanks for the work on this…it’s not 100% what I’m after – but I’ll bet it’ll make a lot of people happy. :)

I’ll report back after I’ve had a chance to test some more.

Just a quick note: if you want to try this plugin you will need to upgrade the jquery 1.2.6 that comes with TXP to jQuery 1.3.1 that the plugin requires. I don’t know if this will break anything else (so hang on to a copy of 1.2.6).

I’ve been experimenting a lot with adi_menu this week (it’s really quite an amazing plugin).
If we can somehow work towards merging the 2 ideas I think we’d be just about there.


Tom

Offline

#24 2009-02-07 14:59:51

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: [request] Bounty: Ultimate Nav Menu Builder

renobird wrote:

This looks like a great start! There are definitely some nested menu plugins out there – I’ll see what I can find.

Yup, the jQuery/interface side is not the problem. I’m having issues with the interal technical stuff. I’m not sure how to go about outputting nested navigation elements (subsections) and the database storage/retrieval of the data from the lists needs some carfull planning. I don’t have much experience in that field either.

Just a quick note: if you want to try this plugin you will need to upgrade the jquery 1.2.6 that comes with TXP to jQuery 1.3.1 that the plugin requires. I don’t know if this will break anything else (so hang on to a copy of 1.2.6).

Yes, but I’ve fixed that with an easy workaround. The plugin now calls to the 1.3.1 filename. No need to overwrite the original jquery.js that comes with Textpattern. Please download the updated version.
bq. I’ve been experimenting a lot with adi_menu this week (it’s really quite an amazing plugin).
If we can somehow work towards merging the 2 ideas I think we’d be just about there.

Yup, that was the idea when I started this piece of code: get the interface drag/drop/sorting part going. To fullfill my own needs for a simple navigation builder it quickly evolved into this plugin. If anyone steps up to build the plugin discussed in this thread, I’m happy to help on that end of it. Technically it’s just too complex for me to do all of it.

Last edited by jelle (2009-02-07 15:02:18)

Offline

#25 2009-02-07 21:22:21

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: [request] Bounty: Ultimate Nav Menu Builder

jelle wrote:

Also I have no idea how to do subsections in textpattern….any help would be appreciated, I’m looking at the obvious TXP plugins to see how it’s done.

It’s straightforward really – just add some extra columns to the database and mix in together with some tree hierarchy code.

jelle wrote:

Yup, that was the idea when I started this piece of code: get the interface drag/drop/sorting part going. To fullfill my own needs for a simple navigation builder it quickly evolved into this plugin.

Looks like I need to have a play with your drag & drop experience! Sounds great.

If anyone steps up to build the plugin discussed in this thread, I’m happy to help on that end of it. Technically it’s just too complex for me to do all of it.

Perhaps we should have a go, especially as Javascript not my thing. Not sure if this interface can be a bolt-on for adi_menu or whether some new background code is required. Need to ponder such things.

renobird – I know one of the things you’re after is the section hierarchy in the article Write tab. I’ll do some work towards that end. Got to crawl before we can walk!

Offline

#26 2009-02-07 21:51:21

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: [request] Bounty: Ultimate Nav Menu Builder

Gomedia Wrote

I know one of the things you’re after is the section hierarchy in the article Write tab. I’ll do some work towards that end. Got to crawl before we can walk!

That would be awesome!

This is all heading in the right direction – I’m excited.

:)


Tom

Offline

#27 2009-02-07 21:55:14

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: [request] Bounty: Ultimate Nav Menu Builder

P.S.

gomedia wrote

especially as Javascript not my thing

That’s the beauty of jQuery – you don’t have to know a lick of javascript to understand it.

:)

Offline

#28 2009-02-08 22:35:30

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: [request] Bounty: Ultimate Nav Menu Builder

gomedia wrote:

It’s straightforward really – just add some extra columns to the database and mix in together with some tree hierarchy code.

I’ve been studying your plugin. Very informative…

jelle wrote:

Perhaps we should have a go, especially as Javascript not my thing. Not sure if this interface can be a bolt-on for adi_menu or whether some new background code is required. Need to ponder such things.

Anything I can do to help, let me know.

Last edited by jelle (2009-02-08 22:36:49)

Offline

#29 2009-02-10 04:18:31

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: [request] Bounty: Ultimate Nav Menu Builder

Tom’s had a play with it already but just for the record adi_menu 0.8beta has the required section hierarchy in the Article Write tab.

jelle wrote:

I’ve been studying your plugin. Very informative…

Thanks … I think … “informative” in a good way I hope!

I’ve installed your jvh_navbuilder plugin. Very nifty.

I’m thinking out loud here, but I’m wondering if jvh_navbuilder could be a sexy front end to the not-very-exiting adi_menu? Three main reasons really:

  • it would save having to reinvent the adi_wheel
  • it would give users two interface alternatives, because:
    • old fashionistas might prefer a conventional table layout
    • there may be features in adi_menu that you don’t want to implement in jvh_navbuilder
    • we should be careful not to disenfranchise users on browsers that can’t handle jQuery
  • operation & development of the two can run in parallel and only need to collide at the point when you click “Save”

And continuing along the lines of reusing ideas, perhaps we should make use of the way stm_article_order does its thing?

So to summarise, rather than jvh_navbuilder having it’s own database table, maybe you could make use of the way adi_menu stores it’s information and maybe I could make use of the way stm_article_order stores its article bits & bobs.

Last edited by gomedia (2009-02-10 04:19:23)

Offline

#30 2009-02-10 12:54:38

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: [request] Bounty: Ultimate Nav Menu Builder

gomedia wrote:

So to summarise, rather than jvh_navbuilder having it’s own database table, maybe you could make use of the way adi_menu stores it’s information and maybe I could make use of the way stm_article_order stores its article bits & bobs.

Yes, that’s why your code was a quite interesting read (indeed in a positive way)…I’m getting to grips with how you handle and save the data.

jvh_navbuilder (when finished) will be a sort of “lite” navigation builder offering easy drag-drop section navigation building. Wheras a new incarnation of adi_menu, as you describe above, would be a complete navigation/article manager.

Right now I’m experimenting with jsTree as a replacement for my jvh_navbuilder interface. jsTree has loads of features which makes coding and data handling a lot easier, it integrates perfectly with jQuery and the design is very nice and clean.

I’ll be back with a completely new jvh_navbuilder later this week and I’ll keep an eye on the data handling part of it so the interface can easilly lifted over to adi_menu (or any other plugin).

Last edited by jelle (2009-02-10 12:54:56)

Offline

Board footer

Powered by FluxBB