Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Location of K2 category.php

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi Folks,

I was searching the internet to show some module positions only in the items, not in the category view. I found a solution:
'add this code anywhere to /html/com_k2/default/category.php'
<style type="text/css">
#sidebar2 { display: none; }
</style>
What's the location of this file? I checked in templates/responsive2/html/ but there is no sub directory com_k2/default.

Grtz,
Dick
  • Dick Mulder's Avatar
  • Dick Mulder
  • 12 Month basic
  • 90 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Dick,

I'm a bit unclear what you are trying to do regarding

"show some module positions only in the items, not in the category view. I found a solution:
'add this code anywhere to <style type="text/css">
#sidebar2 { display: none; }
</style>"

Do you want one layout in categories and a different one in items?

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,

I want some modules shown in the K2 items, not in the K2 itemlist. Gavick (and some other designers) says that it's possible when you make a small change in the category.php file of K2.
I can't find the location of the file. Usually this is the path to the file: templates/template-name/html/com_k2/default/category.php
until the html-part it's there, but then there's no com_k2 directory.

Grtz,
Dick
  • Dick Mulder's Avatar
  • Dick Mulder
  • 12 Month basic
  • 90 posts
  • Karma: 0
The administrator has disabled public write access.
  • Dick Mulder's Avatar
  • Dick Mulder
  • 12 Month basic
  • 90 posts
  • Karma: 0
The administrator has disabled public write access.
Right so you are looking to add an override for this - I'm assuming as with the post you mention you can't link to the individual k2 items?

Are you using zenkit?

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
I think I didn't made myself clear. I want to show some modules in the sidebar, but only in the K2 items, not when I click on a menu item to show a category. Let's assume that I want to show some items with a few modules in the sidebar2 position. But I don't want the modules to show up in the category listing.
This is good: green-island.holiday/index.php/en/holiday-accommodation/corfu-villas/villa-aphrodite-corfu
This is not what I want: green-island.holiday/index.php/en/holiday-accommodation
I hope I made myself clear.

Grtz,
Dick
  • Dick Mulder's Avatar
  • Dick Mulder
  • 12 Month basic
  • 90 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Dick,

Yep I'm just wondering if you can use menu links for individual items rather than create an override

The links could be on a hidden menu rather than the main menu and then its a case of just assigning as required

Obviously if you had lots of links this is a non starter

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
The following user(s) said Thank You: Dick Mulder
Just chipping in here.

The K2 override doesn't control the sidebar content. I would probably use Advanced Module manager from Nonumber which gives more fine grained control over where and when module appear. Rather than creating a dedicated K2 override.

As per the initial question.

Zenkit templates do not reside in the template folder so that's why there is no html/com_k2 folder in the template.

To edit the category.php you go to
com_k2/templates/[your template]/k2.php

hope that helps.
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
The following user(s) said Thank You: Dick Mulder
That's the problem, I don't want a hidden menu to link to all the separate accommodation (in this case). So I'm looking for a method to not show a module in the category, just show them in the separate items.
  • Dick Mulder's Avatar
  • Dick Mulder
  • 12 Month basic
  • 90 posts
  • Karma: 0
The administrator has disabled public write access.
Feel free to chip in! :-)
I tried the siet after changing the php-file and it worked to good: nothing showed up :-(
I will look further, I think there must be a way to show modules not in the category, but though in the items of that category. I will check NoNumber. I already bought his Tabs module. Fellow country man of mine...

Grtz,
Dick
  • Dick Mulder's Avatar
  • Dick Mulder
  • 12 Month basic
  • 90 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Dick,

You could try a layout with that module position excluded perhaps as an alternative solution - although that would mean assigning to particular pages so that rule that out

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
The following user(s) said Thank You: Dick Mulder
Adding a module position to a component's markup is possible but it's no small task depending on your skill level.

The solution the Gavick mod is actually to just hide the module output with css.

In our templates you can do something like this:

.com_k2.task-category .sidebar {display:none}

If you needed to just target a single module then you would add a module class suffix (hideme) to the module and then add something like this:

.com_k2.task-category .hideme {display:none}

Just look in the html tag to see what task or view class is being rendered to see which task or view you need to target.

This is hiding the item so the markup will still display in the page. Itherwise you would need to add more complex php to the templates tpls/ files to have it not load at all.
Thanks
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
The following user(s) said Thank You: Dick Mulder
Thanks very mucho for all your help and advice guys. I admire you for that.
In the meantime I took your advice Anthony, and purchased Peter van Westens Advanced Module Manager. That worked out!
See the directory: green-island.holiday/index.php/en/holiday-accommodation and click on one of the items and you know what I was looking for :-)
Thanks again,
Dick
  • Dick Mulder's Avatar
  • Dick Mulder
  • 12 Month basic
  • 90 posts
  • Karma: 0
The administrator has disabled public write access.
Thanks Dick - good luck with the site

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers