0
Welcome Guest! Login
0 items Join Now

HTML Override Best Practice?

  • HTML Override Best Practice?

    Posted 12 years 2 months ago
    • I'm curious if anyone can share the best practice for creating a Joomla 2.5 HTML template override that will survie template upgrading?

      I understand how to us custom.css or custom.less files to isolate CSS template changes, but what is the equivalent for HTML? I've googled for documentation an on this and have several articles that hint at this technique, but none seem to hit the nail on the head.

      A nudge in the right direction or a link to a good tutorial would be much appreciated!

      Thanks, SL
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: HTML Override Best Practice?

    Posted 12 years 2 months ago
    • There really isn't a "standard" way for this type of thing. You just need to come up with a strategy that will work for you - a system that allows you to keep track of what you've done. Like: make backups of everything before updating and be sure to document all your custom changes during development for later reference. It doesn't have to be complicated, you just have to prepare for it in some way.

      Overrides are more complicated than CSS files. The override itself is an override of a core file - and there isn't a way to create a template file that overrides the override. Updates to components or extensions that require you to update the overrides will come from whoever made the component or extension. For example, if you have a com_content override to change a Joomla core content layout, and Joomla updates the core file, you have to update your override. There isn't any way around that situation, you just have to find a way to deal with it. That situation specifically is a main reason we do not do custom com_content overrides in our templates, it's very difficult to manage and no one know what the Joomla updates will change until they come out.

      A handy tool is a file comparison program that lets you compare two files or folders and points out the differences in them, a good one will let you update the specific lines of code that have been changed. There are a lot of them out there that are reasonably priced. I just recently started using one, and I can't believe I ever got by without it.

      When you do custom development of any kind, you're stepping into a situation that is unique to what you're doing in most cases - so you're not going to find a lot of answers that relate specifically to that situation. There is no right or wrong, just find something that works for you, that's honestly the best answer I can give you.
    • The difficult we do immediately, the impossible takes a little longer.

Time to create page: 0.162 seconds