Bug in Alternate Layout for Category-Layout

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
enigmartin
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sat Nov 15, 2008 8:38 am

Bug in Alternate Layout for Category-Layout

Post by enigmartin » Thu Nov 08, 2012 10:42 pm

Hello Folks,

I have tried to set own layout for my portfolio and it does not work. Joomla still use the Layout wich is set by Menu-Item. I have looked for a solution in the web, but I don't find anything. I don't know if the mistake comes by me or by Joomla.

Now, I have looked where the alternate layout is set, and found view.html.php of com_content, com_contact, com_weblinks and com_newsfeeds. There is following to find in all files:

components/com_content/views/category/view.html.php (Line 119)
components/com_contact/views/category/view.html.php (Line 111)
components/com_weblinks/views/category/view.html.php (Line 101)
components/com_newsfeeds/views/category/view.html.php (Line 109)

Code: Select all

if ((!$active) || ((strpos($active->link, 'view=category') === false) || (strpos($active->link, '&id=' . (string) $this->category->id) === false))) {
I change this line to following:

Code: Select all

if (isset($active) || ((strpos($active->link, 'view=category') === false) || (strpos($active->link, '&id=' . (string) $category->id) === false))) {
Then it works fine.

I have test it only with com_content/views/categories and I have test if my alternate layout is selected and is not selected. Is the layout selected for category "Portfolio" then it use it, and is Blog-Layout selected it use Blog-Layout. Before my changing this does not work.

Do you understand me. My english is not the best, I can better speak german. ;-)

One more thing in this context: I have test to set the Layout by portfolio.xml, too (http://docs.joomla.org/Layout_Overrides ... Menu_Items). This does not work too. If I have select the Layout via Menu Item, then I can't select the category and if I have save it, there comes an error in the frontend. There is no categorie_id in URL (id=10). If I add the right categorie_id to the url, the error on frontend is away and the alternate layout by menu-item is not loaded.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 37006
Joined: Sat Apr 05, 2008 9:58 pm

Re: Bug in Alternate Layout for Category-Layout

Post by Webdongle » Thu Nov 08, 2012 11:50 pm

Could you please create a Tracker(with a link to this thread) at http://joomlacode.org/gf/project/joomla ... er_id=8103 ?

Your explanation is clear.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein

enigmartin
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sat Nov 15, 2008 8:38 am

Re: Bug in Alternate Layout for Category-Layout

Post by enigmartin » Sun Nov 11, 2012 1:47 pm

I have tried something.

I have take the "components\com_content\views\category\tmpl\blog.xml" and copied it to "templates\mytemplate\html\com_content\category\portfolio.xml". Now I can change the Menu Item and can select this Layout for this Menu Item. This really works.

Is that intentional? Do I have to create an xml configuration for the template?

Here is Tracker Item the http://joomlacode.org/gf/project/joomla ... m_id=29661

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 37006
Joined: Sat Apr 05, 2008 9:58 pm

Re: Bug in Alternate Layout for Category-Layout

Post by Webdongle » Sun Nov 11, 2012 2:06 pm

http://docs.joomla.org/Layout_Overrides ... Menu_Items

If you had not previously created an xml file and it now works after you created one ... Then this is not a bug ? Did creating the xml file solve your problem ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein

enigmartin
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sat Nov 15, 2008 8:38 am

Re: Bug in Alternate Layout for Category-Layout

Post by enigmartin » Mon Nov 12, 2012 9:58 am

Yes, this solve my Problem, but it is not clearly. Would it not be enough if you create only the PHP files?

Otherwise, the layout should not be displayed in the backend, if I have not created the xml file.


Locked

Return to “Joomla! 3.x Bug Reporting”