• Register or
  • Sign In
    • Forgot your password?
    • Forgot your username?
    Or sign in with your account on:
    Facebook
    Twitter
    Google
    LinkedIn

K2 | The powerful content extension for Joomla! developed by JoomlaWorks

  • home
  • about
  • blog
  • documentation
  • extend K2
  • showcase
  • community
  • demo
K2 brings the good parts from Drupal and Wordpress into Joomla!
You are hereDocumentation Tips & Tricks Enable category ancestors routing

Enable category ancestors routing

12 July 2012, 17:00 by Shillo
in Tips & Tricks
  • Print/PDF
Recently, I noticed that K2 wouldn't fetch menu item for items in a category that is not a direct parent of it. For example: 
I have My Article which is in the category B, which is a a descendant of the root category A. I created a K2 Categories menu item which uses A as the category. If I viewed My Article by clicking a link from the website I wouldn't retrieve a Menu Item.

The reason it's happening
After digging into the K2's routing system, I noticed it doesn't allow for category ancestors routing. In our case, this means that even though My Article is in a category which is a descendant of A, you still wouldn't get a Menu Item for that, you must have created a specific menu item that uses B.

The fix
In simple words, the fix is to add support for category ancestors routing.
In technical words I have modified two core files of K2 in order to achieve this kind of routing behaviour, therefore if you use this fix you should be careful about it.
I have attached the two files with this message.

Tags:

  • Categories ,
  • items ,
  • routing ,
  • Breadcrumbs fix
Tweet

Download Attachments

  • itemlist.php
  • route.php

Docs Tag Cloud

2009 2010 2011 advanced beginner case study checkbox checkboxlist extra fields frontend editing germany greece greek images item editing jab10 jandbeyond jd11gr joomla 15 joomla 17 joomladay k2 grup k2 kurulum k2 türkçe Ken Crowder netherlands presentation screencast tags upgrading
Download K2 for Joomla! 1.5, 2.5 & 3.x v2.6.6 (GNU/GPL) / Released April 7th, 2013
Join theK2 CommunityLooking for help with K2? Join the K2 Community Forum! Login using your Twitter or Facebook account, or your old K2 Community credentials.
K2 TranslationsK2 has already been translated into more than 50 languages. Download a Joomla! 1.5 - 2.5 compatible language pack now!
  • Contact us
  • Join the K2 Expert Companies list
  • Privacy Policy
back to top
Copyright © 2006 - 2013 JoomlaWorks Ltd.. All rights reserved. K2 is a joint project by JoomlaWorks Ltd. & Nuevvo Webware Ltd., released under the GNU/GPL v2 license.
Joomla! is a registered trademark of Open Source Matters, Inc. JoomlaWorks/Nuevvo are not affiliated with or endorsed by Open Source Matters or the Joomla! Project.
designed by Nuevvo