Back button redirect to article

Phoca Gallery - image gallery extension
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Back button redirect to article

Post by Jan »

Hi, yes, this is a feature - detail of an image or images in category are displayed by Phoca Gallery component. If you are going from content to Phoca Gallery, then the system of Phoca Gallery works there (back link is going to categories view).

So this must be customized - you need to modify the link back and hardcode the backlink to your article. (This cannot be set as default in Phoca Gallery, as Phoca Gallery does not know from which article and which link can be clicked by user)

Jan
If you find Phoca extensions useful, please support the project
hockey2112
Phoca Member
Phoca Member
Posts: 24
Joined: 28 Jul 2009, 03:41

Re: Back button redirect to article

Post by hockey2112 »

Jan wrote:Hi, yes, this is a feature - detail of an image or images in category are displayed by Phoca Gallery component. If you are going from content to Phoca Gallery, then the system of Phoca Gallery works there (back link is going to categories view).

So this must be customized - you need to modify the link back and hardcode the backlink to your article. (This cannot be set as default in Phoca Gallery, as Phoca Gallery does not know from which article and which link can be clicked by user)

Jan

Jan,

Can you please elaborate on which code/file I need to modify to hard-code the gallery view's back button? I need it to point back to an article.

Thanks!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Back button redirect to article

Post by Jan »

Hi, this is in fact in different files.

e.g. you need to check the template of category view (where the images boxes are displayed) but the view.html.php too.

In model of the category view there the links are loaded from database.

in view.html.php - there will be decieded if the box will be: image, or subcategory, or backlink to categories view. so try to open:

components/com_phocagallery/views/category/view.html.php and find the link back to categories view and change the link there.

Jan
If you find Phoca extensions useful, please support the project
hockey2112
Phoca Member
Phoca Member
Posts: 24
Joined: 28 Jul 2009, 03:41

Re: Back button redirect to article

Post by hockey2112 »

Jan wrote:Hi, this is in fact in different files.

e.g. you need to check the template of category view (where the images boxes are displayed) but the view.html.php too.

In model of the category view there the links are loaded from database.

in view.html.php - there will be decieded if the box will be: image, or subcategory, or backlink to categories view. so try to open:

components/com_phocagallery/views/category/view.html.php and find the link back to categories view and change the link there.

Jan

Jan,

Thanks for the reply, but I am still a bit lost. I checked these files and made some changes, but it did not do what I wanted it to do (it seemingly did not do anything, actually):

components/com_phocagallery/models/category.php
I couldn't find anything referring to the "back" link in this file.

components/com_phocagallery/views/category/view.html.php
I changed all of the links listed in this file to the article page link ("photo-gallery") and nothing changed.

Maybe I am misunderstanding what to change or which file(s) to change. Can you please elaborate a bit? Better yet, if you could point me to the actual line items in each file, that would be awesome!

Just to be sure I am completely clear in what I want to do...
1. The gallery itself has the URL mysite.com/gallery
2. The article I want to link the back button to is mysite.com/photo-gallery
3. On the mysite.com/photo-gallery article page, I have a photo menu I created myself and each photo menu item links to a phoca category (for instance, mysite.com/gallery/category/1-bouquets). The back button on mysite.com/gallery/category/1-bouquets (and the other phoca category pages) needs to link back to mysite.com/photo-gallery instead of to mysite.com/gallery

Thanks!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Back button redirect to article

Post by Jan »

Hi, here:

components\com_phocagallery\views\category\view.html.php
e.g.

Code: Select all

// ----------------------------------------
		// PARENT FOLDERS(I) or Back Button STANDARD
		// ----------------------------------------		

	   
		$posItemid		= $posItemidNull = $backLinkItemId = false;
		$backLink 		= PhocaGalleryRoute::getCategoriesRoute();
Here you can see the backlink, so you need to customize it (but cannot say it is 100%, I am not on my PC so cannot test it)

Jan
If you find Phoca extensions useful, please support the project
hockey2112
Phoca Member
Phoca Member
Posts: 24
Joined: 28 Jul 2009, 03:41

Re: Back button redirect to article

Post by hockey2112 »

On line 1371, I changed this:

Code: Select all

		$backLink 		= PhocaGalleryRoute::getCategoriesRoute();
To this:

Code: Select all

		$backLink 		= 'index.php?option=com_content&view=article&id=9&Itemid=15';
And it works perfectly. THANK YOU for your help, Jan!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Back button redirect to article

Post by Jan »

Great to hear it.

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