Keyword

How to show module only on k2 item page only

  • Muhammad Jabir
  • Muhammad Jabir's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 months ago #114415 by Muhammad Jabir
How to show module only on k2 item page only was created by Muhammad Jabir
Hi ,

How to show module only on k2 item page only

Please help very urgent

thank y

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

More
11 years 3 months ago - 11 years 3 months ago #114416 by Eric
from the modules edit screen below the "details" area, there will be called "Menu Assignment", in the "Module Assignment" drop down choose "only on the selected page" then put a check box next to the page you want it on, and remove it from any other ones that have it

if "all pages" is currently selected, choose "no pages" first to clear the check box out of all of them

i like to modify things, and make them do unintended things
Attachments:

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

  • Muhammad Jabir
  • Muhammad Jabir's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 months ago #114417 by Muhammad Jabir
Replied by Muhammad Jabir on topic Re: How to show module only on k2 item page only
thanks eric

pls answer another question

How to show metamod module only on k2 item page only no display category page

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 3 months ago #114418 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: How to show module only on k2 item page only
Hello Muhammad,

Please do not double post, you will not receive any sooner if you double post.

You have to look at this thread getk2.org/community/New-to-K2-Ask-here-first/178143-Problem-K2-component--item-list-in-item-error

That snippet excludes the modules from items but need something very similar to implement.
					
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
11 years 3 months ago - 11 years 3 months ago #114419 by Eric
the above post confuses me...

your asking about how to show a certain view within that module (metamod extension), not within the page right?

i like to modify things, and make them do unintended things

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 3 months ago #114420 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: How to show module only on k2 item page only
I am sorry the code should be
<?php if($option=='com_k2' && $view=='item'): ?>

Remove one set of parenthesis and the exclamation mark.

This code is for your template's index.php not for a module.

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

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

More
11 years 1 month ago - 11 years 1 month ago #114421 by ghandil
I want to show a module position on all pages except "item pages".
In template files it was defined if the right/left positions weren't loaded the main container will fill more space in percentage; with the class would be assigned to it :
Log in  or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 1 month ago #114422 by Yiota
You will probably have to include the ($option=='com_k2' && $view=='item') check in this function as well.
Which of the two module positions have you made the check for?

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

More
11 years 1 month ago #114423 by ghandil
Thanks for reply,
I have checked if right position (position-5) was not loaded (that certainly wasn't loaded on item pages), then the container gets "span9" class.
Here I posted a complete overview of what I mean :
stackoverflow.com/questions/18459720/cant-set-true-conditional-div-class-for-responsive-layout

Thank You

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 1 month ago #114424 by Yiota
Try with this code snippet to not load the right position.
<?php   
 $com = JRequest::getCmd('option');
 $view  = JRequest::getCmd('view');   
 if($com=='com_k2' && $view!='item'): ?>
 <jdoc:include type="modules" name="position-5" style="xhtml" />
<?php else: ?>
 <jdoc:include type="modules" name="position-custom" style="xhtml" />
<?php endif ?>

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