Keyword

Different modules for K2 items layout.

  • Lefteris
  • Lefteris's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 weeks ago #118128 by Lefteris
Different modules for K2 items layout. was created by Lefteris
Hello,

I'm new to K2. Not really sure if this is a K2 question but since it's about K2 item layout i'll give it a shot here.

I've setup a website and working with a Menu now with sub categories (Football (A league, B league etc etc..)).

Problem is i have a layout ready for the categories and all the modules show up fine but i want the k2 item layoute, (article layout) to be different than the categories one. I want to show different modules there.

Is it possible to edit or create a K2 item layout for each category of mine??

Thank you

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 3 weeks ago #118129 by Yiota
Replied by Yiota on topic Re: Different modules for K2 items layout.
You could use the Advanced Module Manager (download it here www.nonumber.nl/extensions/advancedmodulemanager#download) which has the option to select whether or not to show modules in category or item pages as a quick solution or you can do it by adding code to your index.php.

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

  • Lefteris
  • Lefteris's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 weeks ago #118130 by Lefteris
Replied by Lefteris on topic Re: Different modules for K2 items layout.
Already tried the Advanced module but it throws a warning that the module i'm using is not supported by the Advanced Module Manager so i guess i will have to go with the code part.

Any more info you can give me on this part?

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

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 3 weeks ago #118131 by Yiota
Replied by Yiota on topic Re: Different modules for K2 items layout.
You can use a module position and handle in which case it will show with an if statement through your index.php in your template.

For example, you say you need different modules showing to your item pages.

First define this variable. Check first if they are defined already somewhere else.

$view = JRequest::getCmd('view');

Then try this code snippet for the module positions
<!-- Show this module position for the item pages only -->
<?php if($this->countModules('MODULE_NAME_SHOWING_IN_ITEMS') && ($view=='item')): ?>
<jdoc:include type="modules" name="MODULE_NAME_SHOWING_IN_ITEMS" style="xhtml" />
<?php endif; ?>

<!-- Show this module position for all other pages except the item page -->
<?php if($this->countModules('MODULE_NAME') && ($view!='item')): ?>
<jdoc:include type="modules" name="MODULE_NAME" style="xhtml" />
<?php endif; ?>

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


Powered by Kunena Forum