Navigation problem

Phoca Gallery - image gallery extension
sercio
Phoca Member
Phoca Member
Posts: 22
Joined: 17 Dec 2011, 17:40

Navigation problem

Post by sercio »

Hi,
i have a problem about Navigation option.
I have a menu item with type Caterories list.
I click on the item and i can view the list of all the categories. I have activated navigation for categories and for imagins list in the menu item options.
When i click on a category, the page with the images have not the navigation but only 20 images and the back button, so i can't see all the images in a category.
In the title of the page i see Article - Category. Why Article?
Can you help me?
sercio
Phoca Member
Phoca Member
Posts: 22
Joined: 17 Dec 2011, 17:40

Re: Navigation problem

Post by sercio »

Hi,
i have found a lost parameter.

I create a menu item type Categories view.

the url is like this...

http://www.santaprisca.it/index.php?opt ... 72&lang=it

where Itemid param is the id of the menu entry and i have a list of my categories.

When i click on a category the url is like this

http://www.santaprisca.it/index.php?opt ... 03&lang=it

and there isn't the param Itemid, so the i have not the pagination and sort field because this features are defined into the Menu Item and i have lost this information in the url.
If i manually add the param in the url all work fine.

I think this is a bug...
Is it possible to fix it?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Navigation problem

Post by Jan »

Hi, this seems to be related to the changes to find right ID when more that one menu link is created, please try to open this file:

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

and change
FROM:

Code: Select all

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;
		if (isset($active->id)){
			$activeId    = $active->id;
		}
		if ((int)$activeId > 0 && $option == 'com_phocagallery') {
		
			$needles 	= array(
				'category' => (int)$catid,
				'categories' => (int)$activeId
			);
		} else {
			$needles = array(
				'category' => (int)$catid,
				'categories' => ''
			);
		}

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

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

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

		return $link;
	}
TO:

Code: Select all

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
		} 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;
	}

And let me know if it works for you, when yes, I will change it for the next release.

Thank you, Jan
If you find Phoca extensions useful, please support the project
sercio
Phoca Member
Phoca Member
Posts: 22
Joined: 17 Dec 2011, 17:40

Re: Navigation problem

Post by sercio »

Hi Jan,
It's work fine.

Thank you very much
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Navigation problem

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Navigation problem

Post by Jan »

Hi, set in version 4.3.0

Jan
If you find Phoca extensions useful, please support the project
sercio
Phoca Member
Phoca Member
Posts: 22
Joined: 17 Dec 2011, 17:40

Re: Navigation problem

Post by sercio »

Hi,
i have update to 4.3.4 and plugin 4.3.1 and now I have the problem again....
sercio
Phoca Member
Phoca Member
Posts: 22
Joined: 17 Dec 2011, 17:40

Re: Navigation problem

Post by sercio »

I have replaced the route.php code again.... now work fine. Please modify the distribution........
Thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Navigation problem

Post by Jan »

"replaced the route.php code again"? Which code you have used? The one listed here is stored in latest version :idea:

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