Page 1 of 1

Layout override doesn't work

Posted: 14 Jul 2013, 21:58
by jedivader
Layout override doesn't work with Phoca Gallery (I'm currently using version 3.2.6).

In order to make it work, I had to add the following code:

Code: Select all

		$active = JFactory::getApplication()->getMenu()->getActive();
		if (isset($active->query['layout'])) {
			$this->setLayout($active->query['layout']);
		} 
in function display in components\com_phocagallery\views\category\view.html.php

Same thing has to be done for every view you want a layout override for.

This should be implemented by default.

Re: Layout override doesn't work

Posted: 19 Jul 2013, 20:50
by Jan
Hi, for now this is planned, the standard MVC override feature does work and the additional features are planned - but first the extensions needs to be overwritten for next Joomla! version.

Jan

Re: Layout override doesn't work

Posted: 25 Feb 2014, 12:27
by ataman79
Hi I am using Phoca Gallery 3.2.7

I want to override com_phocagallery/views/category/view.html.php - (some changes in displaying the Page title)

What should I do to make the override work

I create in my template/html folder the new ones com_phocagallery/views/category/view.html.php

But the verride didn't work. Should I use the code from above

Code: Select all

 $active = JFactory::getApplication()->getMenu()->getActive();
      if (isset($active->query['layout'])) {
         $this->setLayout($active->query['layout']);
      }
And if yes where should I put it ?

Thank you in advance

Re: Layout override doesn't work

Posted: 02 Mar 2014, 21:53
by jedivader
ataman79 wrote:Hi I am using Phoca Gallery 3.2.7

I want to override com_phocagallery/views/category/view.html.php - (some changes in displaying the Page title)

What should I do to make the override work

I create in my template/html folder the new ones com_phocagallery/views/category/view.html.php

But the verride didn't work. Should I use the code from above

Code: Select all

 $active = JFactory::getApplication()->getMenu()->getActive();
      if (isset($active->query['layout'])) {
         $this->setLayout($active->query['layout']);
      }
And if yes where should I put it ?

Thank you in advance
You should put it where I said I put it in my original post:
jedivader wrote:in function display in components\com_phocagallery\views\category\view.html.php
In my code it's right before this line:

Code: Select all

$neededAccessLevels	= PhocaGalleryAccess::getNeededAccessLevels();

Re: Layout override doesn't work

Posted: 03 Mar 2014, 17:47
by ataman79
Thanks for the answer,
ok I put it in components\com_phocagallery\views\category\view.html.php

after that in my template folder I create the same folder structure template/mytemplate/html/com_phocagallery/views/category and copy the file view.html.php

and made my changes BUT they are not applied. :(

Is my folder structure for overriding is ok , or I made a mistake ?

Re: Layout override doesn't work

Posted: 03 Mar 2014, 23:04
by jedivader
ataman79 wrote:Thanks for the answer,
ok I put it in components\com_phocagallery\views\category\view.html.php

after that in my template folder I create the same folder structure template/mytemplate/html/com_phocagallery/views/category and copy the file view.html.php

and made my changes BUT they are not applied. :(

Is my folder structure for overriding is ok , or I made a mistake ?
It's wrong, it should be like this:

templates\mytemplate\html\com_phocagallery\category

and you should be overriding the php files from components\com_phocagallery\views\category\tmpl, you can't override view.html.php

Re: Layout override doesn't work

Posted: 04 Mar 2014, 20:02
by ataman79
I see, thank you

I wanted to edit view.html.php , because there I found the code I wanted to change , connected to the browser site name order ... $title = JText::sprintf('JPAGETITLE', $title, htmlspecialchars_decode($app->getCfg('sitename')));
}

But finally I decided not to hard code the view.html.php, I will change the browser sitename using the Joomla menu

Thanks again