XF 2.0 How to export the master templates?

Yugensoft

Well-known member
Hi all,
I'm going through the dev resources for XF2, but I can't identify why this isn't working:

Code:
php cmd.php xf-designer:enable master-style designer_mode_1
No style with ID 'master-style' could be found.

php cmd.php xf-designer:enable 0 designer_mode_1
No style with ID '0' could be found.

Am I somehow naming the style id wrong? Or is there some other process used to export the master templates?

It appears I need to the "designer mode id" to do any export commands, so the first step above must clear for me to do so.
 
What are you trying to do specifically? Designer mode is for designing custom styles, thus you would identify the ID of the style you're working on, not the master style.
 
What are you trying to do specifically? Designer mode is for designing custom styles, thus you would identify the ID of the style you're working on, not the master style.

It's a frequent workflow when making addons to inspect templates, to find where to inject new code (e.g. via hooks or mods), or to reuse templates or pieces of them in templates for the addon (refactoring) to maintain functional or visual consistency. So having them all readily searchable and viewable (with full syntax highlighting) in the IDE is valuable. I currently have this at the moment for XF1 using a custom webdav plugin I made.
 
If you want all master templates to be written out, you need to enable development mode. If you want the XF templates to be written out, you need an extra line as well:

Code:
$config['development']['enabled'] = true;
$config['development']['skipAddOns'] = [];

Then you can use the CLI commands in the xf-dev namespace (including import/export).
 
Top Bottom