Assigning Custom Template to Menu Items Does Not Work
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
-
- Joomla! Apprentice
- Posts: 6
- Joined: Thu Apr 07, 2011 3:12 pm
Assigning Custom Template to Menu Items Does Not Work
I have a website that I am setting up for designing custom templates for clients using Joomla 1.7. I would like to be able to have multiple custom templates loaded and have them applied when a client has logged in and clicks a menu link that is specific to their user access group. I currently have 2 templates installed, and both work independently if set as the default template. However I can not get it to switch templates to anything other than the default template. I'm not sure if this is a bug or if I am simply missing a step in the process.
Here is how my current configuration is set up:
Default Template - Beez20
Custom Template - tmp_name (changed for confidentiality reasons)
Default Template Menu Assignments -
Home
Custom Template Menu Assignments -
Client Link ( From Home Menu )
All Links on client specific menu
I have verified both from the Menu Module and from the Template manager that the assigned template for the the Client Link is set to the custom template, however, when they click the link it still applies the Beez20 template.
Is there somewhere else that I need to look to make the template assignments work?
Any help would be greatly appreciated as right now I have to do a completely separate Joomla! installation for each custom template that I am designing and that is getting very, very tiresome.
Thanks
Here is how my current configuration is set up:
Default Template - Beez20
Custom Template - tmp_name (changed for confidentiality reasons)
Default Template Menu Assignments -
Home
Custom Template Menu Assignments -
Client Link ( From Home Menu )
All Links on client specific menu
I have verified both from the Menu Module and from the Template manager that the assigned template for the the Client Link is set to the custom template, however, when they click the link it still applies the Beez20 template.
Is there somewhere else that I need to look to make the template assignments work?
Any help would be greatly appreciated as right now I have to do a completely separate Joomla! installation for each custom template that I am designing and that is getting very, very tiresome.
Thanks
Last edited by toivo on Sat Dec 08, 2018 8:20 am, edited 2 times in total.
Reason: mod note: locked topic as requested
Reason: mod note: locked topic as requested
-
- Joomla! Apprentice
- Posts: 6
- Joined: Thu Apr 07, 2011 3:12 pm
Re: Assigning Custom Template to Menu Items Does Not Work
I did find a "psudo" solution to this issue so I thought I'd post and reply to my own question.
It appears that the issue resides in the SEF/SEO setting. If you go to your "Global Configuration" and turn off SEF the template changes are then applied.
I hope that there will be a fix at some point that will allow for the use of SEF and still have multiple templates.
For now I will just turn it off on my development site to allow me to display more than one custom template.
Hope this helps someone else who is struggling with this issue.
It appears that the issue resides in the SEF/SEO setting. If you go to your "Global Configuration" and turn off SEF the template changes are then applied.
I hope that there will be a fix at some point that will allow for the use of SEF and still have multiple templates.
For now I will just turn it off on my development site to allow me to display more than one custom template.
Hope this helps someone else who is struggling with this issue.
-
- Joomla! Enthusiast
- Posts: 203
- Joined: Fri Aug 04, 2006 12:38 pm
Re: Assigning Custom Template to Menu Items Does Not Work
It's not working for me either. Both templates are there in the template interface, and the 2nd template is assigned to the contact form. The 2nd template was discovered and installed successfully. But the contact form still shows the default template. Turning off SEF urls is not an option if you care about SEO.
-
- Joomla! Enthusiast
- Posts: 203
- Joined: Fri Aug 04, 2006 12:38 pm
Re: Assigning Custom Template to Menu Items Does Not Work
This workaround might work: http://stackoverflow.com/questions/3269 ... ic-article
-
- Joomla! Apprentice
- Posts: 38
- Joined: Wed Jun 24, 2009 6:51 am
Re: Assigning Custom Template to Menu Items Does Not Work
Hi Guys,
I found a solution for shwiching templates when SEF is active.
Inside root/includes/application.php
search for this line: public function getTemplate($params = false)
Inside that function I added a single line code:
This is the line added by me:
Hope this help you.
Byee.
I found a solution for shwiching templates when SEF is active.
Inside root/includes/application.php
search for this line: public function getTemplate($params = false)
Inside that function I added a single line code:
Code: Select all
// Get the id of the active menu item
$menu = $this->getMenu();
$item = $menu->getActive();
if (!$item) {
//added here here the new line by Raluca Manea
$this->route();
//END CODE CHANGED added here here the new line by Raluca Manea
$item = $menu->getItem(JRequest::getInt('Itemid'));
}
Code: Select all
$this->route();
Byee.
-
- Joomla! Intern
- Posts: 67
- Joined: Thu May 22, 2008 1:40 pm
- Location: Philadelphia, PA
- Contact:
Re: Assigning Custom Template to Menu Items Does Not Work
THAT WORKED!!! Thanks so much!
Now, I have to remember to fix this again after the next upgrade.
Now, I have to remember to fix this again after the next upgrade.
- dex
- Joomla! Explorer
- Posts: 337
- Joined: Tue Oct 18, 2005 9:44 pm
- Location: Sydney - Australia
- Contact:
Re: Assigning Custom Template to Menu Items Does Not Work
Thanks manearaluca
It worked for me too! I am using J 2.5.1
Dex
It worked for me too! I am using J 2.5.1
Dex
Dex
Joomla implementor
http://www.spikesystems.com.au
http://www.joomla.org.au - Aussie Joomla user groups & events
Joomla implementor
http://www.spikesystems.com.au
http://www.joomla.org.au - Aussie Joomla user groups & events
- Webdongle
- Joomla! Master
- Posts: 44068
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Assigning Custom Template to Menu Items Does Not Work
The default Template does not need to be assigned to a menu item. If you want one Template for Home and another for the other menu items.chriscadcw wrote:...
Here is how my current configuration is set up:
Default Template - Beez20
Custom Template - tmp_name (changed for confidentiality reasons)
Default Template Menu Assignments -
Home
Custom Template Menu Assignments -
Client Link ( From Home Menu )
All Links on client specific menu
...
Example:
You want Template 'A' for the Home menu item and Template 'B' for the rest of the site. So ...
Template 'B' as default no assignment because it will show on all except menu items assigned to another Template.
Template 'A' assigned to to the Home page.
That way you avoid conflicts and do not need to edit any code.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
-
- Joomla! Apprentice
- Posts: 38
- Joined: Wed Jun 24, 2009 6:51 am
Re: Assigning Custom Template to Menu Items Does Not Work
The solution I gave above works. But I found another problem which I can't handle it.
I installed two T3 framework templates (more precisely, two templates from http://www.joomlart.com), but with SEF activated, it generates different html page and ruin the entire design.
Do you know what could be wrong?
Thank you,
Raluca.
I installed two T3 framework templates (more precisely, two templates from http://www.joomlart.com), but with SEF activated, it generates different html page and ruin the entire design.
Do you know what could be wrong?
Thank you,
Raluca.
- Webdongle
- Joomla! Master
- Posts: 44068
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Assigning Custom Template to Menu Items Does Not Work
Obviously your solution caused more problems than it solved.manearaluca wrote:The solution I gave above works. But I found another problem which I can't handle it.
Yes, ... you edited a core file instead of correctly using the settings in Joomla admin. Please re read my example http://forum.joomla.org/posting.php?mod ... &p=2756092manearaluca wrote:...
Do you know what could be wrong?
...
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
-
- Joomla! Apprentice
- Posts: 38
- Joined: Wed Jun 24, 2009 6:51 am
Re: Assigning Custom Template to Menu Items Does Not Work
Yes, thank you so much.
I understand now.
I understand now.
-
- Joomla! Apprentice
- Posts: 25
- Joined: Fri May 13, 2011 8:05 am
- Location: Sydney, Australia
- Contact:
Re: Assigning Custom Template to Menu Items Does Not Work
Perfect worked for me too, Awesome thanks for the help.
-
- Joomla! Apprentice
- Posts: 15
- Joined: Sat Aug 22, 2009 10:44 am
Re: Assigning Custom Template to Menu Items Does Not Work
thanks manearaluca!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
i spent almost a day trying to fix it until i stumble on your solution (5 minutes -- done!!!). thank u, thank u, thank u.
Ben F.
i spent almost a day trying to fix it until i stumble on your solution (5 minutes -- done!!!). thank u, thank u, thank u.
Ben F.
-
- Joomla! Apprentice
- Posts: 24
- Joined: Wed Jan 19, 2011 7:14 am
Re: Assigning Custom Template to Menu Items Does Not Work
The Fix: $this->route();
has created issues with K2 Modules, Jom Social & jComments (Captcha) on my site, so I really suggest people avoid using it. Those are just the ones I have come across so far too.
My site was being staged on a local server first and then I moved it to a live site and I feel this might have something to do with the issue, did everyone else who have had this problem do the same thing?
has created issues with K2 Modules, Jom Social & jComments (Captcha) on my site, so I really suggest people avoid using it. Those are just the ones I have come across so far too.
My site was being staged on a local server first and then I moved it to a live site and I feel this might have something to do with the issue, did everyone else who have had this problem do the same thing?
- jkwebdesign
- Joomla! Apprentice
- Posts: 26
- Joined: Fri Apr 15, 2011 6:04 pm
- Location: Varkaus, Finland
- Contact:
Re: Assigning Custom Template to Menu Items Does Not Work
What the hell could cause this? Im working on a site maded with 2.5.6 and have same problem. I have done many sites with multiple templates and this is first time when this occurs.
And intresting thing is that first this was working and it suddenly stopped. I know i have configured it right so that is not a problem. And it is working when SEF is off. I also tried it with 3rd party sef components but it is broken with those too. I´m not sure what i was doing when it stopped working but i know that only thing related to menus or templates was one edit in menu manager: I changed menu type from one contact to breezing forms form. That menu item was on default template so it isn´t even related to that menu item using other template.
I have looked db and i can´t see anything broken there.. Template association id looks also correct.
Templates i use are maded with Artisteer but that isn´t a problem because default templates arn´t working either. And this was also working before.
I was planning to announce my new site tomorrow but im not sure anymore because i really don´t like core hacs. I also tried this hack and it worked without any problems..
Any help would be nice and if someone talent wan´t to look my ste/db just take contact and i will send you info.
And intresting thing is that first this was working and it suddenly stopped. I know i have configured it right so that is not a problem. And it is working when SEF is off. I also tried it with 3rd party sef components but it is broken with those too. I´m not sure what i was doing when it stopped working but i know that only thing related to menus or templates was one edit in menu manager: I changed menu type from one contact to breezing forms form. That menu item was on default template so it isn´t even related to that menu item using other template.
I have looked db and i can´t see anything broken there.. Template association id looks also correct.
Templates i use are maded with Artisteer but that isn´t a problem because default templates arn´t working either. And this was also working before.
I was planning to announce my new site tomorrow but im not sure anymore because i really don´t like core hacs. I also tried this hack and it worked without any problems..
Any help would be nice and if someone talent wan´t to look my ste/db just take contact and i will send you info.
We offer first-rate and versatile Internet, marketing and graphic services..
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
- jkwebdesign
- Joomla! Apprentice
- Posts: 26
- Joined: Fri Apr 15, 2011 6:04 pm
- Location: Varkaus, Finland
- Contact:
Re: Assigning Custom Template to Menu Items Does Not Work
Ok, hack isnt for me.. 40° Portfolio component doesn´t work when i applied that hack.. This is kind of day i hate a lot!
We offer first-rate and versatile Internet, marketing and graphic services..
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
-
- Joomla! Apprentice
- Posts: 12
- Joined: Wed Dec 22, 2010 6:30 pm
Re: Assigning Custom Template to Menu Items Does Not Work
I am using the hack right now to get my site operating properly, the thought of losing the sef (my site has been up for a couple of years and there are links to many of the pages) is a horrible thought.
I have three problems with the hack in place, remove it and all three problems go away and my site looks broken because I am left with only one template.
Hard to believe that there seems to be no solution and no one seems to be worried about it. I would that thought everyone would be using this function and want SEF as well.
Any other ideas anyone? I am willing to pay for a solution.
G
I have three problems with the hack in place, remove it and all three problems go away and my site looks broken because I am left with only one template.
Hard to believe that there seems to be no solution and no one seems to be worried about it. I would that thought everyone would be using this function and want SEF as well.
Any other ideas anyone? I am willing to pay for a solution.
G
- jkwebdesign
- Joomla! Apprentice
- Posts: 26
- Joined: Fri Apr 15, 2011 6:04 pm
- Location: Varkaus, Finland
- Contact:
Re: Assigning Custom Template to Menu Items Does Not Work
Ok, now i have found out that my problem is related to Abivia Supertable plugin (http://extensions.joomla.org/extensions ... ists/18972). When i disable it, everything works ok. Everything is working with that plugin when sef is off so the problem occurs on when sef in on and that Supertable plugin is on.
I have reported this to developer of Supertable extension and he have also looked into this but have not found any fix. He thinks that this is Joomla related bug. Here is quote of his answer and link to that Forum topic:
"
So... I have a test case where the SEF URL ignores the template assignment, but the non-SEF URL works fine, at the same time, in the same install with both SEF and SuperTable enabled.
This means it's a Joomla problem, and it's probably not an easy one. SuperTable doesn't even run until long after this thing should have been decided -- honestly they're so unrelated I thought I could run a quick test and show that your problem had to be something else.
I'm going to look into it, but it might get hairy. Trying to see if I can get a few more Joomla devs to look at it too. Hopefully we can get to the bottom of it.
"
Source:
http://www.abivia.net/forum/11-supertab ... -in-jo#772
I have reported this to developer of Supertable extension and he have also looked into this but have not found any fix. He thinks that this is Joomla related bug. Here is quote of his answer and link to that Forum topic:
"
So... I have a test case where the SEF URL ignores the template assignment, but the non-SEF URL works fine, at the same time, in the same install with both SEF and SuperTable enabled.
This means it's a Joomla problem, and it's probably not an easy one. SuperTable doesn't even run until long after this thing should have been decided -- honestly they're so unrelated I thought I could run a quick test and show that your problem had to be something else.
I'm going to look into it, but it might get hairy. Trying to see if I can get a few more Joomla devs to look at it too. Hopefully we can get to the bottom of it.
"
Source:
http://www.abivia.net/forum/11-supertab ... -in-jo#772
We offer first-rate and versatile Internet, marketing and graphic services..
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
-
- Joomla! Apprentice
- Posts: 12
- Joined: Wed Dec 22, 2010 6:30 pm
Re: Assigning Custom Template to Menu Items Does Not Work
Wow
I just disabled supertable and it looks like problem solved.
I feel fantastic!!!
Thanks so much.
I wasn't even using supertable.
Woo HOo
G
I just disabled supertable and it looks like problem solved.
I feel fantastic!!!
Thanks so much.
I wasn't even using supertable.
Woo HOo
G
- jkwebdesign
- Joomla! Apprentice
- Posts: 26
- Joined: Fri Apr 15, 2011 6:04 pm
- Location: Varkaus, Finland
- Contact:
Re: Assigning Custom Template to Menu Items Does Not Work
Great that i could help. Maybe someone near Joomla can ficure out what is wrong? I have solved my problem by editing Supertable plugin (wich is awesom..) but it would always be better that i don´t need to use custom code.
We offer first-rate and versatile Internet, marketing and graphic services..
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
-
- Joomla! Apprentice
- Posts: 24
- Joined: Thu Dec 04, 2008 9:19 pm
Re: Assigning Custom Template to Menu Items Does Not Work
Hey jkwebdesign,
Would you mind sharing how you edited the Supertable plugin to fix this? I'm having the same problem!!
Would you mind sharing how you edited the Supertable plugin to fix this? I'm having the same problem!!
- jkwebdesign
- Joomla! Apprentice
- Posts: 26
- Joined: Fri Apr 15, 2011 6:04 pm
- Location: Varkaus, Finland
- Contact:
Re: Assigning Custom Template to Menu Items Does Not Work
It was really bad hack but worked for me:) You don´t need to use that anymore because Developer of Supertable have updated his plugin yesterday and now that problem is fixed.twizzlermambo wrote:Hey jkwebdesign,
Would you mind sharing how you edited the Supertable plugin to fix this? I'm having the same problem!!
Problem is somehow related to Mootoold loading so if someone have problems and does not have Supertable installed, try to disable other plugins one in a time and test when it start to work correct. Please report here if you find some extension to cause problems and tell to extension developer that they could fix it.
Link to updated Supertable plugin:
http://www.abivia.net/downloads/joomla- ... oomla-2.5/
We offer first-rate and versatile Internet, marketing and graphic services..
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
http://www.jkwebdesign.fi/en/
http://www.facebook.com/jkwebdesignFI
-
- Joomla! Apprentice
- Posts: 24
- Joined: Thu Dec 04, 2008 9:19 pm
Re: Assigning Custom Template to Menu Items Does Not Work
Downloaded, installed and immediately I was able to assign templates correctly. Thanks for pointing me there!
-
- Joomla! Apprentice
- Posts: 6
- Joined: Thu Mar 07, 2013 10:41 am
Re: Assigning Custom Template to Menu Items Does Not Work
Hi
I've got a new install of Joomla 2.5.9. Uploaded a template (which appears to have been downloaded thousands of times before) and I get the same problem when I assign the new template as 'default' - the 'assigned' green check stays against Beez5 and Beez5 is what shows on the home site, instead of the new template.
I wasn't sure from the posts below just what is the solution for this? One post suggests a reinstall, another a code fix. Could anyone tell me if there is a starightforward fix?
thanks
I've got a new install of Joomla 2.5.9. Uploaded a template (which appears to have been downloaded thousands of times before) and I get the same problem when I assign the new template as 'default' - the 'assigned' green check stays against Beez5 and Beez5 is what shows on the home site, instead of the new template.
I wasn't sure from the posts below just what is the solution for this? One post suggests a reinstall, another a code fix. Could anyone tell me if there is a starightforward fix?
thanks
-
- Joomla! Apprentice
- Posts: 6
- Joined: Thu Mar 07, 2013 10:41 am
Re: Assigning Custom Template to Menu Items Does Not Work
Reinstalled Joomla and now it works... must be some bugs somewhere...
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Apr 26, 2011 4:12 pm
Re: Assigning Custom Template to Menu Items Does Not Work
Now on Joomla 2.5.11 and template assignment with SEF/SEO has not worked since 2.5.9. I have tried the re-install and this did not have any effect.
Is there an update please on the checks/actions to take if only the default template appears when SEF is enabled and different templates have been asigned to different pages.
Has anyone cured this issue on 2.5.11?
Is there an update please on the checks/actions to take if only the default template appears when SEF is enabled and different templates have been asigned to different pages.
Has anyone cured this issue on 2.5.11?
-
- Joomla! Fledgling
- Posts: 2
- Joined: Thu Sep 05, 2013 3:08 am
Re: Assigning Custom Template to Menu Items Does Not Work
That Worked!!! Thanks so much! (y)
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Apr 26, 2011 4:12 pm
Re: Assigning Custom Template to Menu Items Does Not Work
Just a query on the last post saying "That worked thanks"
I assume this is referring to a re-install working to clear the problem.
I had tried a re-install and it did not clear the problem with SEO. Has anyone any other suggestions for clearing this issue.
I assume this is referring to a re-install working to clear the problem.
I had tried a re-install and it did not clear the problem with SEO. Has anyone any other suggestions for clearing this issue.
-
- Joomla! Fledgling
- Posts: 2
- Joined: Thu Jul 03, 2014 2:39 pm
Re: Assigning Custom Template to Menu Items Does Not Work
manearaluca thank you very much!
I spent a lot of time to solve this problem!
In Joomla! 3.3.0 the file "root/includes/application.php" doesn't exist anymore. you can find it in "root/libraries/cms/application/site.php" and inside it, there is a getTemplate() function that you can modify adding $this->route();
I hope it can help someone
bye
I spent a lot of time to solve this problem!
In Joomla! 3.3.0 the file "root/includes/application.php" doesn't exist anymore. you can find it in "root/libraries/cms/application/site.php" and inside it, there is a getTemplate() function that you can modify adding $this->route();
I hope it can help someone
bye
-
- Joomla! Apprentice
- Posts: 8
- Joined: Mon Jun 16, 2014 4:14 pm
Re: Assigning Custom Template to Menu Items Does Not Work
IT WORKS FOR ME!!! THANK YOU SOOOOO VERY MUCH!!!chriscadcw wrote:I did find a "psudo" solution to this issue so I thought I'd post and reply to my own question.
It appears that the issue resides in the SEF/SEO setting. If you go to your "Global Configuration" and turn off SEF the template changes are then applied.
I hope that there will be a fix at some point that will allow for the use of SEF and still have multiple templates.
For now I will just turn it off on my development site to allow me to display more than one custom template.
Hope this helps someone else who is struggling with this issue.