Keyword

[SOLVED] Template Overrides Not Working

  • Nelson Elliott
  • Nelson Elliott's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 3 months ago #115291 by Nelson Elliott
[SOLVED] Template Overrides Not Working was created by Nelson Elliott
I have been working on my item.php and itemform.php templates. I realized I needed to start working on them via overrides, but now my overrides are being ignored.

In fact, I'm not even sure what template is being used. Trying to force an error with bad PHP in site/components/com_k2/templates/default did not result in any front-end changes.

I think I have tried all of the suggestions found here:
getk2.org/community/New-to-K2-Ask-here-first/148319-K2-template-override-problem

. . . but to no avail.

I have tried putting the override in both:

templates/my_joomla_template/html/com_k2/
&
templates/my_joomla_template/html/com_k2/templates

In both cases, the override shows up in the Category Item Layout "Select a template" drop-down, but no changes appear on the front-end, even when I try to force a fatal error.

I'm totally stumped. Any ideas?

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #115292 by Tom
Replied by Tom on topic Re: Template Overrides Not Working
Hi Nelson,
  • Is the item in a category?
  • The category has your template selected?
  • The category has inherit parameter options from another category?

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago - 11 years 3 months ago #115293 by mxmauro
Replied by mxmauro on topic Re: Template Overrides Not Working
Try copying all from components/com_k2/templates into templates/your-template/html/com_k2 and select the "default" template.

I'm not sure if all files are needed altough you override only one or if the template folder must be create in the components/com_k2/templates too but for a single template override, modifying the "default"... works.

Please Log in or Create an account to join the conversation.

  • Nelson Elliott
  • Nelson Elliott's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 3 months ago #115294 by Nelson Elliott
Replied by Nelson Elliott on topic Re: Template Overrides Not Working
Thanks for the responses, guys!

Tom:
1. Yes, the item is in a category.
2. Yes, the category has my template selected.
3. No, the "inherit parameter" is set to "none".

mxmauro:
Thanks for the input. That is how I went about creating my overrides. Even when I set my category to the "default" template and try to force errors, the template does not change.

Maybe it should be noted that I am using sh404sef, but the "table-less" layout option that caused trouble a year or so ago no longer appears in the UI.

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #115295 by BBC
Replied by BBC on topic Re: Template Overrides Not Working
Did you maybe forget plugin for templates override ? Do you use multiple K2 CSS files ?

Please Log in or Create an account to join the conversation.

  • Nelson Elliott
  • Nelson Elliott's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 3 months ago #115296 by Nelson Elliott
Replied by Nelson Elliott on topic Re: Template Overrides Not Working
BBC,
I've been basing my override work on this article:
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

So, I didn't realize there was a necessary plugin. What plugin do I need?

I am not using multiple CSS files.

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #115297 by Tom
Replied by Tom on topic Re: Template Overrides Not Working
I don't think you need additional plugins, I've installed K2 in a fresh joomla installation and works fine for me.

Try this:
  1. Create a new menu as K2 Item.
  2. Select an item that belongs to a category with your overrided template.
  3. Select your (joomla) template in Template Style.
  4. Go to your item through the menu

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #115298 by BBC
Replied by BBC on topic Re: Template Overrides Not Working
Then you dont need CSS plugin.
Give some URL to see problem live. Test also on default J templates.

One stupid question more: What K2 menu item do you use ? And did you chose custom template in Menu Item settings too ?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 3 months ago #115299 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Template Overrides Not Working
BBC is right, no need for a plugin.

I will add one thought. If you are using a commercial template try looking into the framework that came with the template. Some of these frameworks do not follow or respect the normal overriding process.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Nelson Elliott
  • Nelson Elliott's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 3 months ago - 11 years 3 months ago #115300 by Nelson Elliott
Replied by Nelson Elliott on topic Re: Template Overrides Not Working
Okay. I figured out what the problem is. I was trying to use K2 Multirate (joomcar.net/plugin-description). It apparently creates its own "k2_com" type folder with CSS and template assets that override anything else. When the plugin is disabled, my overrides work as expected.

This explains why I couldn't even force a failure. It doesn't seem like that is a good thing for that extension to be doing; I'll have to find another way to accomplish multiple ratings.

Thank you all for the patience and help!

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum