XF 2.1 Template Modification: how to insert code at the bottom of a template

Wildcat Media

Well-known member
I don't know if I should use regex (which I am rusty on), or if there is something I'm missing. I wasn't able to find anything posted here about this.

I'm creating a template modification for one of the macro templates. I only want to add another macro to the bottom of the template. The hacky way to do this is to copy the last few lines of the template I am modifying (and it does work fine that way), but that is one more thing to deal with if a future XF upgrade changes the macro template.

What can I put in "Find:" to help me insert the new code at the bottom of the template?
 
We’d recommend using a regex for that.
Code:
/^.*$/s

In the replace field use $0 for the existing contents to be maintained followed by whatever you’re adding.
 
Would recommend using regex replace, just go with /$/ in the search field and replace it with your content. That'll insert it at the end of the template.

Edit: Welp, sniped.
 
Top Bottom