com_content overrides not working
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: 27
- Joined: Fri Jan 18, 2013 6:14 pm
com_content overrides not working
I am running 2.5.8 and using Mobile Joomla to switch over to mobile site template when loaded from a mobile device.
I am trying to override the default template's com_content and make it display in my mobile site template after copying the files from the template_name/html/com_content folder into my new template's html/com_content folder and editing it. This did not work. I then tried copying appropriate files from components/com_content/views/ into my html/com_content folder in my template like the Joomla docs says to do and this was unsuccessful as well. Any reason this is not working? Any help would be very very much appreciated. Thank you!
I am trying to override the default template's com_content and make it display in my mobile site template after copying the files from the template_name/html/com_content folder into my new template's html/com_content folder and editing it. This did not work. I then tried copying appropriate files from components/com_content/views/ into my html/com_content folder in my template like the Joomla docs says to do and this was unsuccessful as well. Any reason this is not working? Any help would be very very much appreciated. Thank you!
-
- Joomla! Enthusiast
- Posts: 131
- Joined: Sat Apr 14, 2007 9:16 am
- Location: Armenia
- Contact:
Re: com_content overrides not working
It should work if it works in source template. Maybe you have enabled caching? Or there is a typo in "html/com_content" path.chris_dryke wrote:I am trying to override the default template's com_content and make it display in my mobile site template after copying the files from the template_name/html/com_content folder into my new template's html/com_content folder and editing it. This did not work.
-
- Joomla! Apprentice
- Posts: 27
- Joined: Fri Jan 18, 2013 6:14 pm
Re: com_content overrides not working
How I see if caching is enabled?
The folders "html" and "com_content" are spelled like I'm typing it, or were you referring to a specific file(s) inside?
The folders "html" and "com_content" are spelled like I'm typing it, or were you referring to a specific file(s) inside?
-
- Joomla! Enthusiast
- Posts: 131
- Joined: Sat Apr 14, 2007 9:16 am
- Location: Armenia
- Contact:
Re: com_content overrides not working
In Joomla's Global configuration.chris_dryke wrote:How I see if caching is enabled?
I mean that maybe there is capital "I" instead of "l" in "html" or smth like it, but it is very unlikely.chris_dryke wrote:The folders "html" and "com_content" are spelled like I'm typing it, or were you referring to a specific file(s) inside?
-
- Joomla! Apprentice
- Posts: 27
- Joined: Fri Jan 18, 2013 6:14 pm
Re: com_content overrides not working
Well, it's not caching because it's turned off.
It is displaying what is in the html/com_content folder for the default template, not the template that is being viewed.
It is displaying what is in the html/com_content folder for the default template, not the template that is being viewed.
- Per Yngve Berg
- Joomla! Master
- Posts: 30933
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: com_content overrides not working
How is the template selected? Is it assigned to a menu item or something else?
-
- Joomla! Apprentice
- Posts: 27
- Joined: Fri Jan 18, 2013 6:14 pm
Re: com_content overrides not working
When you log on to the site normally, it will display the default template. When you log on using a mobile device, I have Mobile Joomla that makes it detect the mobile device and then it displays a different template for mobile users, so basically a mobile version of the web site.
- Per Yngve Berg
- Joomla! Master
- Posts: 30933
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: com_content overrides not working
In that case it's have to be an issue with Mobile Joomla.
Try to assign the template to a menu item and see if that reads the correct override.
Try to assign the template to a menu item and see if that reads the correct override.
-
- Joomla! Apprentice
- Posts: 27
- Joined: Fri Jan 18, 2013 6:14 pm
Re: com_content overrides not working
I assigned a menu item to the mobile site template and clicked the menu link on the main site (using the default template) and the destination page still looked the same.
-
- Joomla! Enthusiast
- Posts: 131
- Joined: Sat Apr 14, 2007 9:16 am
- Location: Armenia
- Contact:
Re: com_content overrides not working
Do you use sh404sef extension? As far as I remember, previously (I'm not sure about latest releases) it temporary changed template to beez on component rendering, and then changes it back, so that overrides for components are not used (the idea was to use div layouts for com_content from beez template).
-
- Joomla! Apprentice
- Posts: 27
- Joined: Fri Jan 18, 2013 6:14 pm
Re: com_content overrides not working
Negative, I searched through my extension manager and did not see that extension.
-
- Joomla! Enthusiast
- Posts: 131
- Joined: Sat Apr 14, 2007 9:16 am
- Location: Armenia
- Contact:
Re: com_content overrides not working
Then firstly check that overriding correctly works in default MobileJoomla's templates. If it doesn't, there is a conflict with other Joomla extension(s). If it does, most likely some paths for overrides in your template are incorrect.
-
- Joomla! Apprentice
- Posts: 27
- Joined: Fri Jan 18, 2013 6:14 pm
Re: com_content overrides not working
So over the weekend I was able to receive a response from the web designer who had developed the page that applies to my situation here and this is what he said in his email:
Thanks to all for your responses; you guys have a great help so far and I appreciate it highly.
So now my question is just where do I need to put this condition and does anyone even know what this code is going to look likeThe edits won't take effect because the events page is assigned to a specific template file. This is a limitation of the mobile joomla component. You can make it display the mobile_new template by editing the default template file to include a condition: if the current device is mobile - then include the files in the mobile_new template.
Thanks to all for your responses; you guys have a great help so far and I appreciate it highly.
-
- Joomla! Enthusiast
- Posts: 131
- Joined: Sat Apr 14, 2007 9:16 am
- Location: Armenia
- Contact:
Re: com_content overrides not working
Do you really need to use two different mobile templates for your website?
-
- Joomla! Apprentice
- Posts: 27
- Joined: Fri Jan 18, 2013 6:14 pm
Re: com_content overrides not working
No, I just need one. I have the default template that runs normally named "oneshow" and then when you're on a mobile device I have the Mobile Joomla! plug-in that switches the template to my mobile template called "mobile_new".
-
- Joomla! Apprentice
- Posts: 27
- Joined: Fri Jan 18, 2013 6:14 pm
Re: com_content overrides not working
Okay, I think I'm on the right track now...
So in the menu to get to this page that doesn't allow me to show my template overrides, it says the link is "index.php?option=com_content&view=category&layout=oneshow:events&id=11" and what I want to point out is that the "layout" variable is set to "oneshow" - the name of my default template. I know I can get this in my code to detect this setting by using something like
but how do I change this setting when $layout is set to my default template in the code? Thank you!
So in the menu to get to this page that doesn't allow me to show my template overrides, it says the link is "index.php?option=com_content&view=category&layout=oneshow:events&id=11" and what I want to point out is that the "layout" variable is set to "oneshow" - the name of my default template. I know I can get this in my code to detect this setting by using something like
Code: Select all
$layout = JRequest::getCmd('layout');