1

I edited \components\com_content\views\article\tmpl\default.php file to suit my needs, and to output a customized string instead of the default H1 header. The site was running all OK, but when I created a new menu item that I needed, using the backend admin interface, I lost the PHP file default.php modifications, and it got restored to it's initial values. Why did this happen ?

  • Welcome to JSE. Please take our tour and consider giving your account a more "human" name. – mickmackusa Aug 22 at 23:03
2

I have a hard time believing that the file was updated when creating a new menu item. It was more likely updated when updating Joomla. And that is expected. You should never modify core files, they will be overwritten when updating.

Instead you should create a copy of the template and then create layout overrides. There is plenty of documentation regarding this topic:

https://docs.joomla.org/J3.x:How_to_use_the_Template_Manager#Creating_Overrides

https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

https://docs.joomla.org/J3.x:Layout_Overrides_in_Joomla

https://docs.joomla.org/Understanding_Output_Overrides

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.