Menue allocation of category-view

Phoca Gallery - image gallery extension
mpappe
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 29 Nov 2016, 15:41

Menue allocation of category-view

Post by mpappe »

Joomla, Phoca gallery latest versions.

I have a menue "Picture Gallery", type list of categories. This shows the categories correctly. When I select one category is shows the pictures of the category correctly. But this view is now allocated to the Home-menue and not to the "Picture Gallery"-menue. I didn't find any place to influence this.
Best regards Markus
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Menue allocation of category-view

Post by Jan »

Hi, which latest version, there are three, one for 1.5, second for 2.5 and third for 3.5

I assume, it will be 3.5.

What you mean with "this mean is not allocated to the Home menu"

You can create one or more menu links to gallery, to categories view or category view. But you can create only one and then when you visit the gallery, you go through the tree (categories - category - image and back) and in such case there is onle one menu link, in most cases to categories view.

:idea:

Jan
If you find Phoca extensions useful, please support the project
mpappe
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 29 Nov 2016, 15:41

Re: Menue allocation of category-view

Post by mpappe »

Hi

3.5 is correct.
I menat "this is NOW allocated to the home menu". The reason is that the Itemid gets lost.

I might have found a solution in your answer to sercios problem from 9 Mar 2016,
Re: Navigation problem
by Jan » 10 Mar 2016, 18:08

Changing from categories to category the Itemid is lost. If I add the Itemid manually it is fine.
I shall try to apply your solution from 10 Mar 2016.

I think this is a bug. Will here be a solution which hasn't to be added manually?

Best regards
Markus
mpappe
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 29 Nov 2016, 15:41

Re: Menue allocation of category-view

Post by mpappe »

Hi

I changed $notCheckID = 0 to $notCheckID = 1 in the marked line below. Now all is working.
The problem is solved.
Best regards
Markus

in: administrator\components\com_phocagallery\libraries\phocagallery\path\route.php

part:
public static function getCategoryRoute($catid, $catidAlias = '') {

// TEST SOLUTION
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$option = $app->input->get( 'option', '', 'string' );


$activeId = 0;
$notCheckId = 0;
if (isset($active->id)){
$activeId = $active->id;
}
if ((int)$activeId > 0 && $option == 'com_phocagallery') {

$needles = array(
'category' => (int)$catid,
'categories' => (int)$activeId
);
>>>>>>>>>> $notCheckId = 1;// when categories view, do not check id
// we need to check the ID - there can be more menu links (to categories, to category)
} else {
$needles = array(
'category' => (int)$catid,
'categories' => ''
);
$notCheckId = 0;
}

if ($catidAlias != '') {
$catid = $catid . ':' . $catidAlias;
}


//Create the link
$link = 'index.php?option=com_phocagallery&view=category&id='. $catid;

if($item = PhocaGalleryRoute::_findItem($needles, $notCheckId)) {
if(isset($item->query['layout'])) {
$link .= '&layout='.$item->query['layout'];
}
if (isset($item->id) && ((int)$item->id > 0)) {
$link .= '&Itemid='.$item->id;
}
};

return $link;
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Menue allocation of category-view

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply