Keyword

Use different templates / change sorting for same category

  • razen
  • razen's Avatar Topic Author
  • Offline
  • Senior Member
More
9 years 2 months ago - 9 years 2 months ago #145833 by razen
Hello,

I made this database with K2:
minecraft-heads.com/heads

Right now you can choose the entries you see via category and via the clickable tags. But I would like to have several more options:

1. I would like to have a dropdown which lead to a category-view with different sorting. Right now I only know how that I can change the item-ordering with a new menupoint. My idea would be a module with a dropdown where you can decide the ordering, and if you decided how to order it saves this for the next category, too.

I tested a dropdown in Heads-Database / Food & Drinks - this is nothing else then a menu shown as dropdown with a different sorting method, but It wont stay the same if you change the category. Beside: For the amount of Tags and categorys I got, a central modul which can control this would make the work a lot easier...


2. I would like to use different templates for the same category. The reason for better understanding is simple: This is a database and right now I only got the detailed view on it. I would like to create another one with only the images for an overview. But I learned in this thread:
www.joomlaworks.net/forum/k2-en/42092-k2-menu-entry-dont-save-the-options

That the tempalte can only be set in the category - well, for my plans I would need another template via a menupoint and another itemcount per page (means I want to show all items on one page with a different template)
Last edit: 9 years 2 months ago by razen.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 2 months ago #145896 by Krikor Boghossian
Replied by Krikor Boghossian on topic Use different templates / change sorting for same category
Hello,

You can add new menu items and change the sorting options for single categories. The structure will be: /category/popular or /category/alphabetical. However since this is a menu item, the sorting will revert to default when you change to another menu item. In order to save it it would require a custom K2 plugin. You can search at the JED for one.

As for the different layout, you can do this via a JS script which depending on the URL or the menu item id shows or hides elements.
You can have the exact result with some PHP checks as well.
stackoverflow.com/questions/26776112/how-to-retreive-menu-item-id-if-the-url-rewriting-is-enabled-in-joomla-3

All these edits should be performed in your overrides: www.joomlaworks.net/blog/item/194-k2-inheritance-sub-templating

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum