Keyword

WOW ! Major K2 design issue...

  • Sébastien Auclair
  • Sébastien Auclair's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #87013 by Sébastien Auclair
WOW ! Major K2 design issue... was created by Sébastien Auclair
I just realized something very strange.If the main content of the home page is a category listings, clicking one of the item open that content but still under the "home" directory !See www.regionsti.com (French) knowing that "Accueil" is french for "Home".
Click on the item titled "SEW Solutions devient ..."
The SlideShow is still visible and it should not
Look at the URL in the address bar, it is now... hIIp://www.regionsti.com/accueil/item..."accueil" should not be there !

So i have some modules (eg: SlideShow) i just want to display on the home page... because of this K2 behavior, those modules are still displayed when they shouldn't.The url should be something like:
.com/item/sew_solutions_devient...  OR...
.com/news/newsflash/sew_solutions_devient...

How to fix this ?Thanks !

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

More
14 years 8 months ago #87014 by Jiliko.net
Replied by Jiliko.net on topic WOW ! Major K2 design issue...
Hi Sébastien,

Your link doesn't work...

Olivier

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

  • Sébastien Auclair
  • Sébastien Auclair's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #87015 by Sébastien Auclair
Replied by Sébastien Auclair on topic WOW ! Major K2 design issue...
Sorry about this... the link was wrong but the text wasn't.

So it is still www.regionsti.com

Thanks

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

More
14 years 8 months ago #87016 by Jiliko.net
Replied by Jiliko.net on topic WOW ! Major K2 design issue...
Sébastien,

We must login to access your home page...

PS: If you need help in french, you can PM me...

Olivier

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

  • Sébastien Auclair
  • Sébastien Auclair's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #87017 by Sébastien Auclair
Replied by Sébastien Auclair on topic WOW ! Major K2 design issue...
Dam i suck today...

Sorry again for this mistake... the home page was not public...

It is now fixed....

Again sorry... the home page is again accessible now.

Thanks

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

More
14 years 8 months ago #87018 by Jiliko.net
Replied by Jiliko.net on topic WOW ! Major K2 design issue...
Sébastien,

Don't think it's a bug, it's just the item is not in any other menu so the root of the breadcrumb keeps the page where the link of the item is (home).

If you create a menu 'News' that links to the item category, i think your problem will be resolved.

Olivier

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

  • Sébastien Auclair
  • Sébastien Auclair's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #87019 by Sébastien Auclair
Replied by Sébastien Auclair on topic WOW ! Major K2 design issue...
Thanks but it looks like it's the other way around... www.regionsti.com

As you can see, i added a "Nouvelles" menu item pointing to the "News/FlashNews" categories so listing the same items as in the home page.

Not only it doesn't solve the problem, but if you click on the "Nouvelles" menu item and then on one of the newsflash item, it goes back to the home page so "Accueil" comes back into the browser's address bar.

Any clues on how to solve this problem ?

Thanks again !

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

  • Sébastien Auclair
  • Sébastien Auclair's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #87020 by Sébastien Auclair
Replied by Sébastien Auclair on topic WOW ! Major K2 design issue...
This is a major issue for us...

We go live on TV this Sunday to advertise our organization and this new website will receives thousands on visits per day...

This bug make the whole think look quite ugly and i don't want to patch.

Thanks for any help !

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

  • Sébastien Auclair
  • Sébastien Auclair's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #87021 by Sébastien Auclair
Replied by Sébastien Auclair on topic WOW ! Major K2 design issue...
Solution Found !

Had to change function K2HelpRoute::getItemRoute in route.php under the helpers directory.

For some reason, it was adding a menu item id which seams to me like something not very usefull !
I simply commented that part out.
class K2HelperRoute
{

function getItemRoute($id, $catid = 0) {

$needles = array (
'item'=>(int)$id,
'itemlist'=>(int)$catid,
);
$link = 'index.php?option=com_k2&view=item&id='.$id;

//if ($item = K2HelperRoute::_findItem($needles)) {
// $link .= '&Itemid='.$item->id;
//}

return $link;
}

Now, when you click on a Newsflash item under the "Home" page or the "News" page, the link to it becomes conventional as it should be:
www.mysite.com/component/k2/item/73-theselecteditem...

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

More
14 years 8 months ago #87022 by Jiliko.net
Replied by Jiliko.net on topic WOW ! Major K2 design issue...
Sébastien,

The goal of this function is TO ADD AN ITEMID to K2 links (category, user, item, ...)

I think you'll get some other troubles commenting these lines.

Olivier


Sébastien Auclair said:Solution Found !
Had to change function K2HelpRoute::getItemRoute in route.php under the helpers directory.

For some reason, it was adding a menu item id which seams to me like something not very usefull !
I simply commented that part out.
class K2HelperRoute
{

function getItemRoute($id, $catid = 0) {

$needles = array (
'item'=>(int)$id,
'itemlist'=>(int)$catid,
);
$link = 'index.php?option=com_k2&view=item&id='.$id;

//if ($item = K2HelperRoute::_findItem($needles)) {
// $link .= '&Itemid='.$item->id;
//}

return $link;
}

Now, when you click on a Newsflash item under the "Home" page or the "News" page, the link to it becomes conventional as it should be:
www.mysite.com/component/k2/item/73-theselecteditem...

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

  • Sébastien Auclair
  • Sébastien Auclair's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #87023 by Sébastien Auclair
Replied by Sébastien Auclair on topic WOW ! Major K2 design issue...
No it adds the menu item id of 'a' page... and the logic to choose which page gets return by this K2HelperRoute::_findItem function is quite weird... I strongly suspect it's a bug as it adds stuff to the global URI that should really not be there.

The rest of the code adds the proper item id of the item i wish to view.

Olivier Nolbert said:Sébastien, The goal of this function is TO ADD AN ITEMID to K2 links (category, user, item, ...)

I think you'll get some other troubles commenting these lines.

Olivier


Sébastien Auclair said:Solution Found ! Had to change function K2HelpRoute::getItemRoute in route.php under the helpers directory.
For some reason, it was adding a menu item id which seams to me like something not very usefull !
I simply commented that part out.
class K2HelperRoute
{

function getItemRoute($id, $catid = 0) {

$needles = array (
'item'=>(int)$id,
'itemlist'=>(int)$catid,
);
$link = 'index.php?option=com_k2&view=item&id='.$id;

//if ($item = K2HelperRoute::_findItem($needles)) {
// $link .= '&Itemid='.$item->id;
//}

return $link;
}

Now, when you click on a Newsflash item under the "Home" page or the "News" page, the link to it becomes conventional as it should be:
www.mysite.com/component/k2/item/73-theselecteditem...

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

  • Nick Texidor
  • Nick Texidor's Avatar
  • Visitor
14 years 5 months ago #87024 by Nick Texidor
Replied by Nick Texidor on topic WOW ! Major K2 design issue...
I've just been looking into this area as the K2HelperRoute::getItemRoute isn't returning an itemid for me.

The problem I've discovered, is that when I call the getItemRoute with the Id, and CatId, of the item, it never matches the K2 menu item. The reason is that _findItem is checking categories, but not child categories. So for example, if I'm trying to find the correct route for K2 Item Id 1 which is in Category Id 2 (Category Id 2 being a Sub Category of Category Id 1), it never finds it because my main K2 page is told to display the parent category (with Category Id of 1). The only way I can see around this is to select the parent AND all the sub-categories on the main K2 page.

haha... did that make sense?? Basically, I think there's a problem with the _findItem function not taking child categories into account.

N



Olivier Nolbert said:Sébastien,
The goal of this function is TO ADD AN ITEMID to K2 links (category, user, item, ...)

I think you'll get some other troubles commenting these lines.

Olivier


Sébastien Auclair said:Solution Found ! Had to change function K2HelpRoute::getItemRoute in route.php under the helpers directory.

For some reason, it was adding a menu item id which seams to me like something not very usefull !
I simply commented that part out.
class K2HelperRoute
{

function getItemRoute($id, $catid = 0) {

$needles = array (
'item'=>(int)$id,
'itemlist'=>(int)$catid,
);
$link = 'index.php?option=com_k2&view=item&id='.$id;

//if ($item = K2HelperRoute::_findItem($needles)) {
// $link .= '&Itemid='.$item->id;
//}

return $link;
}

Now, when you click on a Newsflash item under the "Home" page or the "News" page, the link to it becomes conventional as it should be:
www.mysite.com/component/k2/item/73-theselecteditem...

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

More
14 years 5 months ago #87025 by Jiliko.net
Replied by Jiliko.net on topic WOW ! Major K2 design issue...
Hi Nick,

The getItemRoute function is used to retrieve an Itemid associated to the item id or the id of the item category.

If you need an Itemid returned for a specific category or subcategory, maybe you could just create the corresponding menu.

Olivier

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

  • Nick Texidor
  • Nick Texidor's Avatar
  • Visitor
14 years 5 months ago #87026 by Nick Texidor
Replied by Nick Texidor on topic WOW ! Major K2 design issue...
Hi Olivier,

Sure, I appreciate it's trying to return the item id of the menu item. The problem is, the Menu Item I have is pointing to the parent category, and showing all child categories. So in my K2DynaMap extension, when I display markers to the K2 Items, the getItemRoute can't find the menu item of the parent category, so I end up with the incorrect set of modules. Ideally, the getItemRoute should probably check the parent category of an item if it can't find any matches on it's own category id.

N



Olivier Nolbert said:Hi Nick,
The getItemRoute function is used to retrieve an Itemid associated to the item id or the id of the item category.

If you need an Itemid returned for a specific category or subcategory, maybe you could just create the corresponding menu.

Olivier

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

More
13 years 10 months ago #87027 by C. Zanardi
Replied by C. Zanardi on topic WOW ! Major K2 design issue...
Hello Nick,

 

Your message opened my eyes on the problem. It is true that K2 when you are using the getItemRoute function is trying to find the Itemid but it is not trying to find in children categories even if the menu is using this feature (the catCatalogMode parameter).

 

I have modified the route.php in the com_k2/helpers directory to include all children using the K2ModelItemlist::getCategoryChilds method:

 

$catCatalogMode = $menuparams->get('catCatalogMode');                        require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'models'.DS.'itemlist.php');              $allChildren = array();            foreach ($catids as $a_cat_id) {              $categories = K2ModelItemlist::getCategoryChilds($a_cat_id, true);              $categories[] = $a_cat_id;              $categories = @array_unique($categories);              $allChildren = @array_merge($allChildren, $categories);            }            $catids = @array_unique($allChildren);

 

From my point of view it is a bug.

 

Hope that helps.

 

Best regards,

 

Christian.

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


Powered by Kunena Forum