com_content overrides not working

Everything to do with Joomla! 2.5 templates and templating.

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.
Locked
chris_dryke
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Jan 18, 2013 6:14 pm

com_content overrides not working

Post by chris_dryke » Fri Jan 18, 2013 6:25 pm

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!

Physicist
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 131
Joined: Sat Apr 14, 2007 9:16 am
Location: Armenia
Contact:

Re: com_content overrides not working

Post by Physicist » Fri Jan 18, 2013 7:06 pm

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.
It should work if it works in source template. Maybe you have enabled caching? Or there is a typo in "html/com_content" path.
Denis Ryabov, JED Checker Developer, Page Speed Optimizer Developer, Mobile Developer.

chris_dryke
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Jan 18, 2013 6:14 pm

Re: com_content overrides not working

Post by chris_dryke » Fri Jan 18, 2013 8:05 pm

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?

Physicist
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 131
Joined: Sat Apr 14, 2007 9:16 am
Location: Armenia
Contact:

Re: com_content overrides not working

Post by Physicist » Fri Jan 18, 2013 8:24 pm

chris_dryke wrote:How I see if caching is enabled?
In Joomla's Global configuration.
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?
I mean that maybe there is capital "I" instead of "l" in "html" or smth like it, but it is very unlikely.
Denis Ryabov, JED Checker Developer, Page Speed Optimizer Developer, Mobile Developer.

chris_dryke
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Jan 18, 2013 6:14 pm

Re: com_content overrides not working

Post by chris_dryke » Fri Jan 18, 2013 8:47 pm

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.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30809
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: com_content overrides not working

Post by Per Yngve Berg » Fri Jan 18, 2013 9:03 pm

How is the template selected? Is it assigned to a menu item or something else?

chris_dryke
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Jan 18, 2013 6:14 pm

Re: com_content overrides not working

Post by chris_dryke » Fri Jan 18, 2013 9:07 pm

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.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30809
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: com_content overrides not working

Post by Per Yngve Berg » Fri Jan 18, 2013 9:12 pm

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.

chris_dryke
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Jan 18, 2013 6:14 pm

Re: com_content overrides not working

Post by chris_dryke » Fri Jan 18, 2013 9:24 pm

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.

Physicist
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 131
Joined: Sat Apr 14, 2007 9:16 am
Location: Armenia
Contact:

Re: com_content overrides not working

Post by Physicist » Fri Jan 18, 2013 10:14 pm

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).
Denis Ryabov, JED Checker Developer, Page Speed Optimizer Developer, Mobile Developer.

chris_dryke
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Jan 18, 2013 6:14 pm

Re: com_content overrides not working

Post by chris_dryke » Fri Jan 18, 2013 10:19 pm

Negative, I searched through my extension manager and did not see that extension.

Physicist
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 131
Joined: Sat Apr 14, 2007 9:16 am
Location: Armenia
Contact:

Re: com_content overrides not working

Post by Physicist » Fri Jan 18, 2013 10:24 pm

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.
Denis Ryabov, JED Checker Developer, Page Speed Optimizer Developer, Mobile Developer.

chris_dryke
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Jan 18, 2013 6:14 pm

Re: com_content overrides not working

Post by chris_dryke » Mon Jan 21, 2013 7:26 pm

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:
The 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.
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 like ???

Thanks to all for your responses; you guys have a great help so far and I appreciate it highly.

Physicist
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 131
Joined: Sat Apr 14, 2007 9:16 am
Location: Armenia
Contact:

Re: com_content overrides not working

Post by Physicist » Mon Jan 21, 2013 8:11 pm

Do you really need to use two different mobile templates for your website?
Denis Ryabov, JED Checker Developer, Page Speed Optimizer Developer, Mobile Developer.

chris_dryke
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Jan 18, 2013 6:14 pm

Re: com_content overrides not working

Post by chris_dryke » Mon Jan 21, 2013 8:18 pm

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".

chris_dryke
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Fri Jan 18, 2013 6:14 pm

Re: com_content overrides not working

Post by chris_dryke » Mon Jan 21, 2013 9:20 pm

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

Code: Select all

$layout = JRequest::getCmd('layout');
but how do I change this setting when $layout is set to my default template in the code? Thank you!


Locked

Return to “Templates for Joomla! 2.5”