Template Externalizer

Template Externalizer is a module that can save CMS Made Simple developers many hours of cutting and pasting.  It allows you to work much more rapidly on projects, particularly if they are large and complex.
externalizer2.png

Template Externalizer is a 3rd party module maintained by Jocelyn Lusseau that is an indispensable tool for CMS Made Simple developers.  This module makes it possible to keep all of your templates as neatly organized files for your favorite editing program, such as Dreamweaver or Aptana Studio 3.

When you edit the source file and then upload it to the Template Externalizer directory on your development server, the template in CMS Made Simple will be automatically updated.

For front-end developers this saves a lot of copying and pasting templates, and it also ensures that you have a backup of all of your templates on your work pc.

How to Install Template Externalizer

The easiest way to install Template Externalizer is to log into your CMS Made Simple admin panel, then find "Module Manager" under "Extensions".  Click the "Available Modules" tab, and then click "T" to see the modules beginning with that letter.  Find Template Externalizer in the list, and click to install it.

If you have problems installing it this way, such as a corrupt XML file, there are two things to try.  First, in Module Manager, click the Preferences Tab, and change the download chunk size to 64kb.  Then try installing the module again.

If that does not work for you, then you can download the source files for the module from the CMS Made Simple Forge at this link.

How to Configure Template Externalizer

Once you have installed the module, you can find the admin panel under "Layout" as "Template Externalizer".

In the admin panel click on the Parameters tab.  Here you can select the name of the folder (inside the tmp folder) that will be used for the templates.

You can also choose the file extension for the Smarty templates.  The default extension is "html", however, I personally prefer to use "tpl" to prevent anyone from actually loading a template as an html page on the site.

You can also set the number of minutes before the externalizer will automatically turn off and delete the folder.  This is an important security feature.

Once you have set the configuration how you like it, click the "Use" tab and click the button to activate the externalizer.

How to Use Template Externalizer

You can use any ftp program and file editor with Template Externalizer, but I personally prefer Aptana because the editor and ftp program are conveniently combined.

First, on your development server, activate the externalizer as described above.

Then in your ftp program download the externalizer folder from the development server to your local source code folders.

Now you can edit the local source folders and simply upload them and the changes will automatically be made in the CMS Made Simple installation.

If you are using an integrated editor and ftp program such as Aptana or Dreamweaver, you can just make your edit, then hit CTRL-S to save it.  And then CTRL-SHIFT-U to upload the file to the development server.

Create New Templates

You cannot create a new template with Template Externalizer by simply uploading a new file to the relevant folder.  Instead you must use the CMSMS Admin Panel to create the template in the database.  Once the template has been created, return to the Template Externalizer admin panel and click the "refresh" button.  This will recreate all of the files in the externalizer folder.  Now you can update this template from your file editor.

Template Externalizer is a great module .  It has saved me many hours of copying and pasting, and I think other CMS Made Simple developers will find it helpful to them as well.

Advanced Usage

The newest version of Template Externalizer includes Global Content Blocks, Search, and also Global Settings such as Metadata, and Default Page Content.  The only modules for which Template Externalizer does not work are those which do not use the CG Extensions module template table in the database.

Conclusion

I find Template Externalizer to be an indispensible tool for keeping my CMS Made Simple project files neatly organized and easily maintained.  This system allows me to return to a project months or years later and eaily maintain it.  If you prefer using an external code editor, I think you will find Template Externalizer greatly boosts your productivity as a CMS Made Simple developer.

Arvixe Hosting

Comments