0
Welcome Guest! Login
0 items Join Now

How to create a Joomla template override

  • How to create a Joomla template override

    Posted 10 years 10 months ago
    • Hi,

      I'm using the RT Anacron template on one of my sites. On this site I want to create some Joomla template overrides. As it seems to me that the expression "template override" may have more than one meaning when using RT / Gantry, I'll give an example of what I intend to do:

      I want to copy the Joomla core file /components/com_content/views/categories/tmpl/default_items.php to the folder /templates/rt-anacron/html/com_content/categories and then make some changes to the html and php code of this file. Things like creating my own php conditions for displaying certain parts of the content. This is what I do more often with Joomla sites, using templates of different makes. Also I learned that I have to start by checking in the template folder if the template already contains an override. If so, then I make my changes to that file rather than to the Joomla core file.

      However, this is the first time that I intend to make such and override to a RT template. I found a file in the template folder but it seems to refer to another file named /templates/rt-anacron/html/base_override.php. I've checked that file as well but it does not contain any code that I recognize as Joomla source code I am used to have in my overrides.

      So my question is: where can I find the code that I am used to see in Joomla template override files?

      I hope you can help me,

      Kind regards,

      Frits
  • Re: How to create a Joomla template override

    Posted 10 years 10 months ago
    • Hello Frits,

      You'll want to place any overrides in the rt_anacron/html/joomla/YOUR_JOOMLA_VERSION/ directory. If you're on 3.3, you can create a /3.3/ directory there and then place a /categories/ in there with your custom default_items.php.

      Let me know if you have any other questions!
    • Kind regards,
      Reggie

      Learn to code for free.
      www.freecodecamp.org
  • Re: How to create a Joomla template override

    Posted 10 years 10 months ago
    • Hi Reggie,

      Thanks for replying so soon. I think I did follow your instructions correctly - I also found folders for Joomla 2.5 and other versions. However, when inserting some test html in the default_items.php file it seems that I cannot see any changes in the front end display.

      Do you have any suggestions as to what I may have done wrong?


      Kind regards, Frits


      Edit: I did flush the Gantry cache.
    • Last Edit: 10 years 10 months ago by Frits Jongbloets.
  • Re: How to create a Joomla template override

    Posted 10 years 10 months ago
    • Sorry, I forgot to mention com_content. So in the end your path should be:

      rt_anacron/html/joomla/YOURJOOMLAVERSION/com_content/categories/default_items.php

      Also ensure every directory has a blank index.html file in it.
    • Last Edit: 10 years 10 months ago by Reggie Simmons.
    • Kind regards,
      Reggie

      Learn to code for free.
      www.freecodecamp.org
  • Re: How to create a Joomla template override

    Posted 10 years 10 months ago
    • Much better now, thanks!

      Frits
  • Re: How to create a Joomla template override

    Posted 10 years 10 months ago

Time to create page: 0.084 seconds