DC Template Manager

11th March 2009 pesche DownloadsExpressionengine [19] Comments Add your own

Blog Headline Image

ExpressionEngine offers the possibility to save templates from the database as files. The biggest advantage of this approach is being able to edit the templates in your favourite editor. Unfortunately, to date there is no built-in mechanism in ExpressionEngine that allows you to perform bulk-operations in order to synchronize your files with the database. DC Template Manager offers a convenient way of moving the contents of many templates between the database and the filesystem simultaneously.

Download DC Template Manager 1.0.1

Overview

The Template Manager module offers functions for bulk-updating templates either in the database based on the filesystem versions or vice versa. The following list shows what operation you can perform on multiple templates and what they do in detail:

Files => Database
This saves the content of the template files (saved in the file-system) back to the database. Before overwriting the contents in the database, a new revision with that content is created. This ensures that no data in the database is overwritten without a backup. The module also checks whether the version saved as a file differs from your current version in the database and only synchronizes templates that have differences.
Database => Files
This function is identical with the Save As File function in the template editor — except that you can perform it on as many templates as you like simultaneously.
Delete All Saved Files
This function deletes all templates from the file-system that were saved as files. The setting Save As File is set to no for the selected templates.

Screenshots

  • Screenshot 0
  • Screenshot 1
  • Screenshot 2
  • Screenshot 3
  • Screenshot 4

Installation

  1. Download the DC Template Manager module.
  2. Unpack the archive contents to your Desktop or to a location of your choice on your hard-drive.
  3. Copy the system/modules/dc_template_manager folder to your system/modules directory.
  4. Copy the language/english/lang.dc_template_manager.php file to your system/language/english directory (or duplicate and modify for any other language).
  5. Copy the themes/dc_template_manager directory to your themes directory on your server. This usually resides in /themes.
  6. Optionally you can also install the extension in this addon. The extension currently offers no additional functionality, but if you have installed the LG Addon Updater extension it can call home and check for updates of the DC Template Manager module.

    Copy the extensions/ext.dc_template_manager.php to your system/extensions directory.

Feedback

This module / extension combo has been tested to work with ExpressionEngine 1.6.6 and higher. Many of the important template handling functions were taken and adapted from the EE codebase. Should you encounter a bug with a lower EE version, please let us know. However, we encourage you to update your ExpressionEngine installation for your own sake.

Changelog

0.9.1

  • Added bulk-update functionality to synchronize file-bases template changes with the templates in the database.
  • First private beta (testing release).

0.9.2

  • Added themes folder and icons.
  • Added template managing functionality to the interface (template overview).
  • Added bulk-saving as file capabilities.
  • Added CHANGELOG.

0.9.3

  • Added bulk-delete template files function.
  • Renamed module from "Updater" to "Manager".

0.9.4

  • Fixed a bug where during files > DB sync template data differences would not be shown to the user for revision.
  • Fixed a bug where wrong template data was saved during files sync in revisions.

0.9.5

  • Added extension as a module combo.

0.9.6

  • Fixed an extension hook bug where this extension would ignore preceding extensions accessing the same hook.
  • Added LG Addon Updater support to the template manager extension.

1.0.0

  • Added donation button.
  • Fixed wording in some error messages.
  • First public release.

Comments

1 March 12, 2009 Cody Lundquist

Great module!  I’ve definitely been needing something like this for some time now.

Thank You!

Cody Lundquist's gravatar

2 March 12, 2009 Leevi Graham

This is a great idea. Serving templates straight from the DB is a bit faster than loading the files. I can see a world where when a bunch of changes are deployed to a live site the templates are added to the db automatically.

Leevi Graham's gravatar

3 March 12, 2009 Cameron Senior

Great Module!

I’ll be installing this right away.

Agree with Leevi’s comment, automatic db insertion of modified templates would be great.

Cameron Senior's gravatar

4 March 12, 2009 PXLated

Great!!!!!!

PXLated's gravatar

5 March 13, 2009 John Faulds

Yep, looks like it’ll be very useful. smile

John Faulds's gravatar

6 March 13, 2009 pesche

@Cody – We needed this so many times and in EE, there was just no way of quickly bulk-update templates. The real pain starts when you accidentally delete or rename a template in EE without updating it first from the filesystem.

@Leevi & Cameron – Yes definitely. This could also be done with on a permanent basis using cron jobs and an action url in the module. We would need to get this feature refined. Keep the ideas coming, there’s definitely room for improvement.

pesche's gravatar

7 March 13, 2009 Steven Grant

I’m probably being quite stupid but I don’t understand what this module does. Can anyone help?

Steven Grant's gravatar

8 March 13, 2009 pesche

@Steven – It allows you to perform bulk-operations like Save as File or bulk-update the database versions of your templates based on your template files saved in the file-system. If you don’t use the Saving Templates to Text Files functionality in ExpressionEngine yet, you definitely should give it a try.

pesche's gravatar

9 March 13, 2009 Steven Grant

Ah right I get it, I think.

So I can select all of the templates in my site and then save to text?

Steven Grant's gravatar

10 March 13, 2009 pesche

Exactly, this and more. All functions supported by this module are listed in the Overview section of this blog post.

pesche's gravatar

11 March 16, 2009 Steven Hambleton

For a second I thought this would allow me to build a template group/template file structure and have it build the database automatically. One can dream!

Steven Hambleton's gravatar

12 March 16, 2009 pesche

@Steven  – We thought of this but dropped the feature in this first release. You’re just much more flexible in terms of template types when you create the structure in the ExpressionEngine control panel and then bulk-save the entire template structure to the file-system.

However, we’ve noted this as a possible feature for a future release: creating the entire template structure on the file-system and then import the structure to the database. However, the template type would probably have to be fixed to Web Page in this approach.

pesche's gravatar

13 September 19, 2009 Peter

Great module!  But it shows this deprecated warning on PHP 5.3.0:

Deprecated: Function ereg() is deprecated in /eepathgoeshere/modules/dc_template_manager/mcp.dc_template_manager.php on line 894

Peter's gravatar

14 October 07, 2009 fred

Ah, this is great!

fred's gravatar

15 October 16, 2009 Hair Salon Perth

Great Job. I think I’m really liking it.

Hair Salon Perth's gravatar

16 October 27, 2009 Porcelain Thimble

Expression Engine is really cool.

Porcelain Thimble's gravatar

17 November 13, 2009 negs

Hi… I am really excited about this module - not using my own text editor is one of the most frustrating things about Expression Engine.

I just installed this module in a new site. I set up all of my templates and then clicked ‘database->files’ and got a list of errors:
   

Update Templates — Errors Occured
    * Could not save template index
    * Could not save template site_css
    * Could not save template rss_2.0
    * Could not save template atom
    * Could not save template search_css
 

(for all the templates)

I disabled extensions, but this didn’t help. I changed permissions of the templates folder to 777 but that didn’t help. Do you know what might be going on here?

EE 1.6.8, PHP 5

negs's gravatar

18 November 13, 2009 negs

Nevermind - this is my bad. My sever path was incorrect for the template folder. I had the relative path when I needed the server path. All is working now.

I am really psyched about this module. Thanks, Design Chuchi!

negs's gravatar

19 November 18, 2009 pesche

Glad it’s working! Let us know if you need anything else regarding the module.

pesche's gravatar

Add Your Comment

Personal Information




Comment *

Settings & Anti-Spam

Remember my personal information

Notify me of follow-up comments?


Related Entries

DC FreeForm GeoIP Extension

1 year, 4 months ago

Fresh from the coding factory comes a new, handy extension. Ever wondered where a visitor…

DC Required Category Extension

1 year, 9 months ago

Oops we did it again! Once stared, you might think you cannot stop it—only one…

URL Field Extension for Expressionengine

1 year, 9 months ago

Not so long after moving our old website to Expressionengine during the relaunch on May…

From Our Journal

DC Template Manager

12 Months, 1 Week ago.

ExpressionEngine offers the possibility to save templates from the database as files. The biggest advantage of this approach is being able to…

DC Feedback Boxes

1 Year and 5 Months ago.

Most website today are interactive – transfer of information is not only one-way but two-way. User are interacting with content: adding, editing…

DC FreeForm GeoIP Extension

1 Year and 5 Months ago.

Fresh from the coding factory comes a new, handy extension. Ever wondered where a visitor who just filled out a FreeForm on…

View the entire journal