- Posts: 15
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- How to show module only on category view and not article view?
How to show module only on category view and not article view?
- Trond
-
Topic Author
- Offline
- New Member
Less
More
15 years 2 months ago #78684
by Trond
Oslo, Norway.
How to show module only on category view and not article view? was created by Trond
I want my website to have one blog with the following in place:Category: 1 column blog (small,300 pixels)Item view: 505 Pixels.I must be able to assign my ad modules to the category view but the ads must not be visible on item view.I'm used to assign the modules easily to the different menu items and disable them on the categories or other menu items that I do not want to display them. Is there a solid solution to prevent modules to show on the articles and only on categories, tag and user blog pages?
Oslo, Norway.
Please Log in or Create an account to join the conversation.
- yaksushi
-
- Offline
- Premium Member
Less
More
- Posts: 157
14 years 10 months ago #78685
by yaksushi
Replied by yaksushi on topic How to show module only on category view and not article view?
I have the same problem, I can't just assign modules to display on all but there is no way for me to get these modules to display on certain items like if a tag is clicked. Anyone found a solution to this?
Please Log in or Create an account to join the conversation.
- esedic
-
- Offline
- Senior Member
Less
More
- Posts: 50
14 years 10 months ago #78686
by esedic
Replied by esedic on topic How to show module only on category view and not article view?
Use Advanced Module Manager: extensions.joomla.org/extensions/administration/admin-structure/10307
It has a lot options, you can control publishing your modules also by K2 categories/items.
It has a lot options, you can control publishing your modules also by K2 categories/items.
Please Log in or Create an account to join the conversation.
- gg4u
-
- Offline
- New Member
Less
More
- Posts: 10
14 years 10 months ago #78687
by gg4u
Replied by gg4u on topic How to show module only on category view and not article view?
hello Elvis
it is not enough, I am just trying it...
- I set up the front page of J to display items from K2 categories (using the "category" option when selecting from "Home" link, menu item type: "Categories" (k2)
- Some modules are to be displayed only in home page, other in all the navigation, everything on the right
Without touching options from the k2 category, wehn browsing in categories' items from the frontpage, NOmodules on the right are displayed.
Wehn option of the K2 cateogry set to fetch specific articles frmo specific categories,
when click on the categories'items ALL the modules modules are displayed ....
It looks like there is a problem with module assignment,.. i cannot tell to display when internal item of k2 categories are displayed..
Please any help.
Advanced Module manageer installed, but i got no results...
If it is too complicated, i am ready to go on skype an d show you the website.. please help, under pressure for the client :O
it is not enough, I am just trying it...
- I set up the front page of J to display items from K2 categories (using the "category" option when selecting from "Home" link, menu item type: "Categories" (k2)
- Some modules are to be displayed only in home page, other in all the navigation, everything on the right
Without touching options from the k2 category, wehn browsing in categories' items from the frontpage, NOmodules on the right are displayed.
Wehn option of the K2 cateogry set to fetch specific articles frmo specific categories,
when click on the categories'items ALL the modules modules are displayed ....
It looks like there is a problem with module assignment,.. i cannot tell to display when internal item of k2 categories are displayed..
Please any help.
Advanced Module manageer installed, but i got no results...
If it is too complicated, i am ready to go on skype an d show you the website.. please help, under pressure for the client :O
Please Log in or Create an account to join the conversation.
- gg4u
-
- Offline
- New Member
Less
More
- Posts: 10
14 years 10 months ago #78688
by gg4u
Replied by gg4u on topic How to show module only on category view and not article view?
It looks like that modules assignement cannot recognize what is "homepage" and what is not.
I also tried, as test, to include a K2_content module.
Also, when clicking an article, the article is displayed and also all the other modules, not regarding if they were assigned only to home page or not...
gg4u said:hello Elvis
it is not enough, I am just trying it...
- I set up the front page of J to display items from K2 categories (using the "category" option when selecting from "Home" link, menu item type: "Categories" (k2)
- Some modules are to be displayed only in home page, other in all the navigation, everything on the right
Without touching options from the k2 category, wehn browsing in categories' items from the frontpage, NOmodules on the right are displayed.
Wehn option of the K2 cateogry set to fetch specific articles frmo specific categories,
when click on the categories'items ALL the modules modules are displayed ....
It looks like there is a problem with module assignment,.. i cannot tell to display when internal item of k2 categories are displayed..
Please any help.
Advanced Module manageer installed, but i got no results...
If it is too complicated, i am ready to go on skype an d show you the website.. please help, under pressure for the client :O
I also tried, as test, to include a K2_content module.
Also, when clicking an article, the article is displayed and also all the other modules, not regarding if they were assigned only to home page or not...
gg4u said:hello Elvis
it is not enough, I am just trying it...
- I set up the front page of J to display items from K2 categories (using the "category" option when selecting from "Home" link, menu item type: "Categories" (k2)
- Some modules are to be displayed only in home page, other in all the navigation, everything on the right
Without touching options from the k2 category, wehn browsing in categories' items from the frontpage, NOmodules on the right are displayed.
Wehn option of the K2 cateogry set to fetch specific articles frmo specific categories,
when click on the categories'items ALL the modules modules are displayed ....
It looks like there is a problem with module assignment,.. i cannot tell to display when internal item of k2 categories are displayed..
Please any help.
Advanced Module manageer installed, but i got no results...
If it is too complicated, i am ready to go on skype an d show you the website.. please help, under pressure for the client :O
Please Log in or Create an account to join the conversation.
- gg4u
-
- Offline
- New Member
Less
More
- Posts: 10
14 years 10 months ago #78689
by gg4u
Replied by gg4u on topic How to show module only on category view and not article view?
ok guys, it looks that modules cannot recognize their assignemtn when I select the option "Select categories" in Parameters (BAsic) of the Menu Item Type "Categories" (k2). You get this options when configuring "Home" link for homepage...
If I select any item, then I got the modules error of displaying ALL the modules on the right also in the internal pages (item pages), disregarding module assignment to be displayed only in homepage
If I don't touch anything, then NONE module is displayed in internal page..
WHAT IS THIS?!
If I select any item, then I got the modules error of displaying ALL the modules on the right also in the internal pages (item pages), disregarding module assignment to be displayed only in homepage
If I don't touch anything, then NONE module is displayed in internal page..
WHAT IS THIS?!
Please Log in or Create an account to join the conversation.
- Damian Gonzalez
-
- Offline
- New Member
Less
More
- Posts: 1
14 years 6 months ago #78690
by Damian Gonzalez
Replied by Damian Gonzalez on topic How to show module only on category view and not article view?
Hey I had this same issue, I solved it by using the MetaMod extension available here: www.metamodpro.com/
When you add the module, go to the PHP section and use this "recipe":
if ($option == "com_content" and ($view == "category" or $view == "section") ) {
return "101,102";
}
Where 101 and 102 are the modules that you want to display only on the blog/list pages, and not the subsequent article pages.
Here are some other threads that will help with you making another recipe:
www.metamodpro.com/forums/topic?id=77
www.metamodpro.com/forums/topic?id=185
When you add the module, go to the PHP section and use this "recipe":
if ($option == "com_content" and ($view == "category" or $view == "section") ) {
return "101,102";
}
Where 101 and 102 are the modules that you want to display only on the blog/list pages, and not the subsequent article pages.
Here are some other threads that will help with you making another recipe:
www.metamodpro.com/forums/topic?id=77
www.metamodpro.com/forums/topic?id=185
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
14 years 6 months ago #78691
by Yiota
Replied by Yiota on topic How to show module only on category view and not article view?
One other way to control the module assignment whether you are in a category view or in an item view is the following.
On your index.php file (in your template) once you locate the module position you can make an if statement
$option = JRequest::getCmd( 'option' );
$view = JRequest::getCmd( 'view' );
if ($option==com_k2 && $view==itemlist) :
load this module position for the category view (or the tag view or the search)
else :
load another module position for the item pages
endif;
You can also play between the $task also and load another module for the tag or search.
On your index.php file (in your template) once you locate the module position you can make an if statement
$option = JRequest::getCmd( 'option' );
$view = JRequest::getCmd( 'view' );
if ($option==com_k2 && $view==itemlist) :
load this module position for the category view (or the tag view or the search)
else :
load another module position for the item pages
endif;
You can also play between the $task also and load another module for the tag or search.
Please Log in or Create an account to join the conversation.
- Faris Nasir
-
- Offline
- New Member
Less
More
- Posts: 3
13 years 10 months ago #78692
by Faris Nasir
Replied by Faris Nasir on topic How to show module only on category view and not article view?
I'm having the the same problem. This happens when a page is not assigned to any menu item, it'll display all modules in the article view.
I have an article slider in the front page, when I clicked the link in the slider, the article/item view would show the modules that are assigned to the front page.
SOLUTION (only for Gantry FW users)
I'm using a Gantry template. Under the template parameters in Template Manager, the last option of the Gantry FW allows you to assign these (unassigned) pages to a menu item. As I don't want any modules to appear in the article view, I assigned it to a menu item that doesn't contain any modules.
If you want other modules to appear in the article view, just create a menu item and assign the desired modules to the menu item. Then, back to the template parameters, assign the pages to the newly created menu item.
Voila, problems solved. But only for Gantry users, unfortunately. (I don't know how to overcome this problem if you're a non-Gantry user..sorry)
P/s: I found out that this is not just a problem of K2, but it also a problem of Joomla! articles. Perhaps this is what they called 'duplicate pages'. The duplicated pages doesn't have any menu item assigned. Maybe an SEF URL components can solve the issue as they can avoid duplicate pages (if i'm not mistaken)
I hope, this helps.
I have an article slider in the front page, when I clicked the link in the slider, the article/item view would show the modules that are assigned to the front page.
SOLUTION (only for Gantry FW users)
I'm using a Gantry template. Under the template parameters in Template Manager, the last option of the Gantry FW allows you to assign these (unassigned) pages to a menu item. As I don't want any modules to appear in the article view, I assigned it to a menu item that doesn't contain any modules.
If you want other modules to appear in the article view, just create a menu item and assign the desired modules to the menu item. Then, back to the template parameters, assign the pages to the newly created menu item.
Voila, problems solved. But only for Gantry users, unfortunately. (I don't know how to overcome this problem if you're a non-Gantry user..sorry)
P/s: I found out that this is not just a problem of K2, but it also a problem of Joomla! articles. Perhaps this is what they called 'duplicate pages'. The duplicated pages doesn't have any menu item assigned. Maybe an SEF URL components can solve the issue as they can avoid duplicate pages (if i'm not mistaken)
I hope, this helps.
Please Log in or Create an account to join the conversation.
- Dylan Humphreys
-
- Offline
- New Member
Less
More
- Posts: 12
13 years 10 months ago #78693
by Dylan Humphreys
Replied by Dylan Humphreys on topic How to show module only on category view and not article view?
Did nobody see Damian Gonzalez's suggestion on Metamod? this is EXACTLY the sort of thing its designed for.
I use it on my site, and it works like a charm.
I use it on my site, and it works like a charm.
Please Log in or Create an account to join the conversation.
- Laurent Robin
-
- Offline
- New Member
Less
More
- Posts: 17
11 years 2 weeks ago #78694
by Laurent Robin
Replied by Laurent Robin on topic Re: How to show module only on category view and not article view?
There is a more simple method which use all standard functionalities.
Just create a category and sub categories. for example the main categorie is "Photos" and the sub categorie is "Photo Albums". Your K2 items are assigned to the "Photo Albums" categorie. Then you create a menu for K2 Category "Photos" which will display also the subcategories so you will be able to see your items there. then assign your module to "Photos" only. You will see your module only there and not by viewing the item.
Just create a category and sub categories. for example the main categorie is "Photos" and the sub categorie is "Photo Albums". Your K2 items are assigned to the "Photo Albums" categorie. Then you create a menu for K2 Category "Photos" which will display also the subcategories so you will be able to see your items there. then assign your module to "Photos" only. You will see your module only there and not by viewing the item.
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- How to show module only on category view and not article view?