XF 2.1 Correct way to edit templates in XF2 ?

mark22

New member
I've been basicly directly editing my PAGE_CONTAINER template to add custom header graphics with my own divs. Over time i've been adding more and more custom html elements to that template, and i realized that this might be a mistake.

For example, with every XF upgrade I hve to revert the template and then re-apply my edits which is becoming more and more cumbersome

Is there a good future-proof way of editing templates so I dont have to re-apply things constantly? With vB I used to basicly make small little plugins, that would find some common anchor text and use that to inject the HTML I wanted.

Is there a similar way to do that with XF? In XF it seems you can't make individual plugins the way you could with vB so i'm totally lost.

Any other tips or advice on the right way of dealing with all this andhelp me save some sanity! Thank you!!
 

Brogan

XenForo moderator
Staff member
For example, with every XF upgrade I hve to revert the template and then re-apply my edits which is becoming more and more cumbersome
In most cases it should be possible to merge the changes - although if the changes you have made are extensive that may not be possible.

Is there a similar way to do that with XF? In XF it seems you can't make individual plugins the way you could with vB so i'm totally lost.
Yes, you can make a custom add-on which consists of just template modifications.
See here: https://xenforo.com/community/threa...-contains-only-template-modifications.178485/
 

mark22

New member
In most cases it should be possible to merge the changes - although if the changes you have made are extensive that may not be possible.


Yes, you can make a custom add-on which consists of just template modifications.
See here: https://xenforo.com/community/threa...-contains-only-template-modifications.178485/

Thank you man, I got started and successfull made my add-on

Now i'm trying to make the Template Modification but having problems
I went to "Appearance" -> "Template modifications" and am under the "Public" tab. But I don't see any option to "Add template modification" as per the https://xenforo.com/xf2-docs/dev/lets-build-an-add-on/ documentation.

Any idea where i went wrong? I think i'm in development mode as I've set $config['debug'] = true; in config.php and the CLI did successfully create the Add-on
 
Top