Keyword

Conditional statements & mod_k2_content link probs

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 8 months ago #61947 by Kelsey Brookes
Rather than develop multiple templates, I prefer to use conditional statements in my templates to choose between the front-page layout and content pages. I do this for a few reasons, which I won't get into, but I feel it's the best way to handle templates.

The site in question is using 1.7 and 2.5.4.

I'm using mod_k2_content on the default page to present recent news items from a category.

I'm using this code to determine if the view is the frontpage or not:

<?php
$menu = JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
?>

My problem is that the readmore links are interpreting the active menu item as default and trying to show the news content on the front page layout.

Does anyone know how I can set it so that they will automatically use the non-default layout?

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

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 8 months ago #61948 by Kelsey Brookes
Replied by Kelsey Brookes on topic Re: Conditional statements & mod_k2_content link probs
I've figured out part of the problem - K2 is appending the itemID of the current page's menu item to the readmore URL it generates.

I've tested this with the core joomla newsflash module which does not do this at all.

Is there any way to strip the itemID from the readmore? I can't see how to do it via template overrides.

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


Powered by Kunena Forum