Keyword

Tricky one. Accordion style items in subcat view

  • bartek mazur
  • bartek mazur's Avatar Topic Author
  • Offline
  • New Member
More
11 years 9 months ago - 11 years 9 months ago #117578 by bartek mazur
Hello,

after spending quite a few hours and running out of ideas I decided to try luck here.
I've got my k2 items listed in sub-categories. There are no items in categories. Categories are linked to menu items. Then the sub-categories are show to choose from. After choosing a subcategory a user sees a list of k2 items assigned to that sub-category. What I want to achieve is to show these items in accordion style. A tried a few modules, but only GA K2 Accordion Module (together with Modules Anywhere) seems to be working for me.

The problem is I don't know where to place the module. I tried placing it in subcategory description (using module syntax), but this way the module is shown both in sub-category items listing and in category view of parent category, what I don't want to happen.

Any ideas how could I place that accordion module, so that it was shown only in subcategory view?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 9 months ago #117579 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Tricky one. Accordion style items in subcat view
Hello bartek,

That requires some coding on your K2 template. Placing modules outside index.php requires a different syntax.

This post will help you (the snippet is the same): getk2.org/community/New-to-K2-Ask-here-first/179348-Adding-advert-at-end-of-every-article

This code is quite generic so you can use it in other parts of your template.
PS. Remember to change the module name and module style

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

  • bartek mazur
  • bartek mazur's Avatar Topic Author
  • Offline
  • New Member
More
11 years 9 months ago #117580 by bartek mazur
Replied by bartek mazur on topic Re: Tricky one. Accordion style items in subcat view
Hello Krikor,

thank you for your reply. That is a solution I had been thinking of as well. However creating a custom module position would require assignining that module to selected pages from Main Menu or to all pages, whereas I need to assign it to subcategory view, which is not a part of main menu.
Unless I get it wrong....

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

  • bartek mazur
  • bartek mazur's Avatar Topic Author
  • Offline
  • New Member
More
11 years 9 months ago #117581 by bartek mazur
Replied by bartek mazur on topic Re: Tricky one. Accordion style items in subcat view
Solved.

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


Powered by Kunena Forum