Template menu assignment not working?

Locked
User avatar
Chris Davenport
Joomla! Ace
Joomla! Ace
Posts: 1384
Joined: Thu Aug 18, 2005 8:57 am
Location: Shrewsbury, Shropshire, United Kingdom

Template menu assignment not working?

Post by Chris Davenport » Mon Jan 26, 2009 4:32 pm

I must be doing something stupid, because I'm sure this used to work....

Install 1.5.9 with sample data.
Extensions -> Template Manager
Click a non-default template, say JA_Purity.
Under Menu Assignment, click Select from List and select a menu from the list, say "Extensions".
Click Save.

Now on the front-end, click "Extensions" and ......

Hmm. I was expecting to see this item with the JA_Purity template, but it still shows with the default template.

Am I doing something wrong, or is this a bug?

Regards,
Chris.
Last edited by Chris Davenport on Wed Jan 28, 2009 9:25 pm, edited 1 time in total.
Chris Davenport

Davenport Technology Services http://www.davenporttechnology.com/
Lion Coppice http://www.lioncoppice.org/

User avatar
Chris Davenport
Joomla! Ace
Joomla! Ace
Posts: 1384
Joined: Thu Aug 18, 2005 8:57 am
Location: Shrewsbury, Shropshire, United Kingdom

Re: Template menu assignment not working?

Post by Chris Davenport » Wed Jan 28, 2009 12:18 pm

This has been bugging me, so I looked into it a bit further....

The problem appears to be that in the getTemplate() method in /includes/application.php line 290 onwards:

Code: Select all

		// Get the id of the active menu item
		$menu =& JSite::getMenu();
		$item = $menu->getActive();

		$id = 0;
		if(is_object($item)) { // valid item retrieved
			$id = $item->id;
		}
the $menu->getActive() call is not returning the active menu object, so $id is always set to 0 and you only ever get the default template.

Can anyone else replicate this?

Chris.
Chris Davenport

Davenport Technology Services http://www.davenporttechnology.com/
Lion Coppice http://www.lioncoppice.org/

User avatar
nanunanu
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Thu Mar 01, 2007 7:35 pm

Re: Template menu assignment not working?

Post by nanunanu » Wed Jan 28, 2009 6:01 pm

I'm having the same issue with 1.5.8. All I get is the default template on all the pages, even though I have assigned my other templates to specific pages (menu assignments)
There's so much yet I don't know

User avatar
Robin
Joomla! Master
Joomla! Master
Posts: 15753
Joined: Thu Aug 18, 2005 10:41 am

Re: Template menu assignment not working?

Post by Robin » Wed Jan 28, 2009 6:45 pm

Hi Chris,

I got a sample install 1.5.9. as well and briefly tested, but I am able to assign and see ja-purity when I assign this to the extension menu item.

This menu item has an Itemid = 40 and when I echo that $id it does return 40.

Here is my sys info:
PHP Built on: Windows NT ROBIN-LAPTOP 6.0 build 6001
Database Version: 5.0.51b-community-nt
Database Collation: utf8_general_ci
PHP Version: 5.2.6
Web Server: Apache/2.2.8 (Win32) PHP/5.2.6
Web Server to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.9 Production/Stable [ Vatani ] 9-January-2009 23:00 GMT
User Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
You do not have anything installed, or configured after the install of J!?

User avatar
nanunanu
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Thu Mar 01, 2007 7:35 pm

Re: Template menu assignment not working?

Post by nanunanu » Wed Jan 28, 2009 7:47 pm

It appears my issue was connected to the TCdropdown extension I had installed, which when I deactivated it my menu assignments worked as they should. So I guess I will have to try another dropdown menu extension which hopefully will not interfere with Joomla! 1.5.8. ( :( Shame --- because I liked how the extension functioned and looked and it was supposed to work with 1.5)
There's so much yet I don't know

User avatar
Chris Davenport
Joomla! Ace
Joomla! Ace
Posts: 1384
Joined: Thu Aug 18, 2005 8:57 am
Location: Shrewsbury, Shropshire, United Kingdom

Re: Template menu assignment not working?

Post by Chris Davenport » Wed Jan 28, 2009 9:22 pm

Okay, I've found the problem and it was my fault. :-[

I was using a checked out version of 1.5.9, but I had a file in the SVN directory where I was hacking some code ages ago. I completely forgot about it. When I exported a test copy it included the bad file.

All working as expected now. Thanks for checking it out Robin. Sorry to have troubled you.

Regards,
Chris.
Chris Davenport

Davenport Technology Services http://www.davenporttechnology.com/
Lion Coppice http://www.lioncoppice.org/

User avatar
eagleshout
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Thu Nov 16, 2006 8:08 pm
Contact:

Re: Template menu assignment not working?

Post by eagleshout » Fri Jan 30, 2009 4:52 am

I'm having a very similar problem with 1.5.9, although I'm not sure which build I'm using or how to check.

Basically I had switched up the default template a couple times and reverted back to my target template and now get no template on all but the homepage. I even switched off my target template reset menu assignments to all and then reactivated as defualt but I'm still getting this:
http://biosreviva.com/index.php/phyto-news

Any help or feedback would be appreciated.

User avatar
eagleshout
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Thu Nov 16, 2006 8:08 pm
Contact:

Re: Template menu assignment not working?

Post by eagleshout » Fri Jan 30, 2009 6:20 am

I figured out SEF settings caused this. With htaccess activated and the necessary configs set I'm back in business: The following posts helped:
http://forum.joomla.org/viewtopic.php?f ... s#p1561628
http://forum.joomla.org/viewtopic.php?f ... s#p1561800
http://forum.joomla.org/viewtopic.php?f ... s#p1562047


Locked

Return to “Q&T 1.5.x Resolved”