XF 1.4 Best way to modify templates

Mr Lucky

Well-known member
Through reading tips and a bit of trial and error I'm gradually understanding how to customise templates etc.

But I have a couple of questions for the experts.
  1. To change something in a template, is it always best to create a template modification rather than edit the code in the actual template?
  2. If I am adding something via a template modification, is there any preference to either:
  • Just add the block of text/code I want to add via Find/Replace?
  • Create a custom template and then just add an include linking to that template via Find/Replace?
Any other methods?
 
Both approaches are valid.

If creating a template modification, try to do the find on the smallest piece of code possible, to avoid issues when the template is updated.

Thanks, that makes sense.

If a template is updated, and the "find" is changed, would there be a warning?

What happens if the templated becomes updated and the "find" then appears twice?
 
If a template is updated, and the "find" is changed, would there be a warning?
No warning, the template modification would no longer be applied.

This is why, when upgrading, you need to check that all template modifications are still valid and are applied.

What happens if the templated becomes updated and the "find" then appears twice?
This is why you need to do the find on the smallest piece of code possible, without being ambiguous.
 
Back
Top Bottom