Keyword

Auto menu mod

  • Guy Borghouts
  • Guy Borghouts's Avatar Topic Author
  • Offline
  • New Member
More
14 years 6 months ago #81558 by Guy Borghouts
Auto menu mod was created by Guy Borghouts
Would it be possible to create a mod that filters out the articles in a list in the same category as the active article? That way you you would only need one mod for all submenu's in categories.There is such a mod for normal Joomal articles by Bob Broughton calles Thiscategory. Saved me lot's of time and my editors too ;-)Cheers,Guy

Please Log in or Create an account to join the conversation.

  • Guy Borghouts
  • Guy Borghouts's Avatar Topic Author
  • Offline
  • New Member
More
14 years 6 months ago #81559 by Guy Borghouts
Replied by Guy Borghouts on topic Auto menu mod
Mmm, am I the only one who sees the huge advantages of this functionality?

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #81560 by Alan Sparkes
Replied by Alan Sparkes on topic Auto menu mod
Looks like mod_k2_tools provides menu functionality....

Not sure I quite understand.
I stumbled here after trying to use the content module as a sub nav listing for a menu item - where the menu item is for example 'about us' and the module just shows the items from that category n the left or right template column. (Main nav is horizontal)

The downside of this is that it doesn't act like a split menu in Joomla style - it receives no active css classes for the current viewed K2 item meaning I cant give it a contextual style highlight.

Can definitely see a need for a K2 menu module that renders items in heirarchical unordered lists. :)

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #81561 by Alan Sparkes
Replied by Alan Sparkes on topic Auto menu mod
Ah I am mistaken - this is categories only. If we are talking about the same thing - a module that renders items output like a menu - then this is a great time saver like (mod_exmenu) whereby instead of creating menu items for sub nav we just render them from the category - problem comes with module assignment though. Becuase the items arent real menu items they need a menu Itemid and can only sensibly inherit a parent ItemId. This means you cant get specific modul eby item display.

I cant see a quick solution forthcoming so will look into and see if can code a quick one

Please Log in or Create an account to join the conversation.

  • Guy Borghouts
  • Guy Borghouts's Avatar Topic Author
  • Offline
  • New Member
More
14 years 6 months ago #81562 by Guy Borghouts
Replied by Guy Borghouts on topic Auto menu mod
Hey Alan, that would be great :-)
You're right, one would only use this mod when your category items would follow the intended site structure. My way of setting up sites is very much category based. Normally I'd only create main menu items (the main categories) and from there use the com_content category listing or the K2 category listing in the content area. But users liked the idea of the submenu on the left of the content to jump to other items in the category. Building and maintaing a site with a few categories: it's fine to use a couple of mods for those submenu's. But with larger sites, many more people maintaining it, it's practically begging for failures in the modules-area. So me and my editors.. we're lazy ;-) One mod to do the category listing for all categories would erase the need for manually adding extra mods or submenus.

I wrote to Bob Broughton who wrote the ThisCategory mod for normal Joomla use, but he hasn't committed himself to converting it to K2. I attached it, maybe it gives you some hints :-)

Cheers,
Guy
Attachments:

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #81563 by Alan Sparkes
Replied by Alan Sparkes on topic Auto menu mod
Ah
Cant code a quick one but have realsied the (obvious) quick win .
Attached screenshot of K2 content module lets you see the setup for rendering a list of articles from a category. The crucial points are:
1. Main parent link must exist and be a K2 category link - thi smodule needs to be set to display on this link
2. Retreive items settings will append the itemid of the parent (main menu link) to each article url
3. This really only works for one category. Sub category items can be shown but they are rendered in the same unordered list block, ie without the heirarchy
4. Active highlight of current item not possible.

I can see two potential ways forward:
One is to create a K2 content category menu item let its params dictate the layout and then then split this with a module.
Or second option would be to just create module that could split a K2 category into a menu as long as there is a parent menu item id. Issue of CSS active highlight still needs dealing with though.

Simple enhancements I'd like to make would be in getting an active css highlight for the one category solution that seems currently available and then work on the sub cat rendering.

Not quite the quick code solution either of us was hoping for!

Guy Borghouts said:Hey Alan, that would be great :-) You're right, one would only use this mod when your category items would follow the intended site structure. My way of setting up sites is very much category based. Normally I'd only create main menu items (the main categories) and from there use the com_content category listing or the K2 category listing in the content area. But users liked the idea of the submenu on the left of the content to jump to other items in the category. Building and maintaing a site with a few categories: it's fine to use a couple of mods for those submenu's. But with larger sites, many more people maintaining it, it's practically begging for failures in the modules-area. So me and my editors.. we're lazy ;-) One mod to do the category listing for all categories would erase the need for manually adding extra mods or submenus.

I wrote to Bob Broughton who wrote the ThisCategory mod for normal Joomla use, but he hasn't committed himself to converting it to K2. I attached it, maybe it gives you some hints :-)

Cheers,
Guy
Attachments:

Please Log in or Create an account to join the conversation.

  • Guy Borghouts
  • Guy Borghouts's Avatar Topic Author
  • Offline
  • New Member
More
14 years 6 months ago #81564 by Guy Borghouts
Replied by Guy Borghouts on topic Auto menu mod
Hey Alan,
That's right, there would not be a quick solution I guess. I'm not a coder, although I can tweak bits here and there. And Bob's code didn't seem that complicated. But I have no clue in K2's build up. Tried to determine K2's category once for my switchable template, but it doesn't work the same way like Joomla.
Your GIF suggest a bit how it could work, but you'd still need to assign several mods or assign to several menu's.

Just out of my head: is it possible when K2 has selected it's article to display (with unique id) to retreive params that indicate to which category it belongs (also an id)? With that id you'd make a new selection in the DB and thus retreive all articles with the same id. Within a mod you wouldn't need to assign it to a category or menuitem and there would be no hassle with subcategories.
But I'm not a coder ;-)

I can imagine that such a thing is a piece of cake for Fortis ;-)

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #81565 by Alan Sparkes
Replied by Alan Sparkes on topic Auto menu mod
Off top of heade (where the air is thinnest) I have not a clue. I need to deconstruct what your saying abit.
However I have just got active higlighting for items working :)

See this:http://community.getk2.org/forum/topics/creating-active-menu-item-css

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #81566 by Markus Thiel

Please Log in or Create an account to join the conversation.

  • Guy Borghouts
  • Guy Borghouts's Avatar Topic Author
  • Offline
  • New Member
More
14 years 5 days ago #81567 by Guy Borghouts
Replied by Guy Borghouts on topic Auto menu mod
Hey Markus, thanks for the tip! That's a big step into the direction I was looking for :-)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum