ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

My first module - Manage templates as external files

February 05, 2008 1:29pm

Subscribe [14]
  • #16 / Feb 06, 2008 1:48am

    Dane Thomas

    139 posts

    This looks great! - might I suggest that you update the file in the original post - as often people will use that to download the plug in (only to realise later on that there may have been an update).

    Edit - you can tell I’ve been staring at this screen for a little long today. Just noticed the big red UPDATED HERE text at the top.  :red:

  • #17 / Feb 06, 2008 1:50am

    tbritton

    714 posts

    It is truly working perfectly.

    Terry

  • #18 / Feb 06, 2008 3:43am

    John Fuller

    779 posts

    Very cool!

  • #19 / Feb 11, 2008 2:08pm

    Joey Trimmer

    128 posts

    Wow, this sounds great! Since this is pre-release I won’t use it on any client sites but I’ll test it out on my personal site. Can’t wait!

  • #20 / Feb 11, 2008 3:22pm

    louis w

    450 posts

    Glad you are interested in this.

    I will have a new release soon which tweaks it a little more. Just waiting on an answer for an outstanding forum question about timezones.

  • #21 / Feb 21, 2008 12:21pm

    Meirion

    127 posts

    Hi Louis,

    I love the sound of this module, having just realised that EE will actually allow me to run flat file templates and I can edit them in Eclipse. (And this was after just two days of editing html in a textarea box - pure backwardsness!)

    However, I installed it, clicked on ‘export templates to files’ and received the following php error:

    Warning: implode(): Bad arguments. in /home/sites/home/web/ee/system/modules/template_files/mcp.template_files.php on line 244
    ————-
    Templates Updated
    Your request has been processed. Results of this action are listed below.

    No templates had been imported. My templates folder is working fine, as I can use the checkbox on the normal EE template edit page to get a copy stored on the file system.

    Any ideas?

  • #22 / Feb 21, 2008 12:22pm

    Meirion

    127 posts

    Actually, just worked it out - I hadn’t checked any of the checkboxes.

    Is there a way I can get ALL of my templates out of the db and into the filesystem to get me started? Don’t want to have to manually export each template really.

  • #23 / Feb 21, 2008 12:31pm

    Meirion

    127 posts

    Actually, I’ve seen that on my list of templates they’re nearly all greyed out due to the ’  Save as File Enabled’ column showing a whole bunch of ‘N’s. Is there a way I can batch set this to ‘Y’ on all my templates, so I can then go ahead and export them all at once?

    Also does anyone have info on performance and other pros/cons of running templates in the db vs file system?

  • #24 / Feb 21, 2008 12:40pm

    louis w

    450 posts

    At the moment there is no way to mass update all the templates. I could work on adding this functionality.

    Thanks for pointing out the error if nothing is checked off. I will make it error more gracefully.

  • #25 / Feb 21, 2008 12:45pm

    Meirion

    127 posts

    Hey Louis,
    I got around the problem with the templates being set to not export to disc by just updating the records in the `exp_templates` table in mysql. So that was easy, but now there is another problem…

    It seems that when Apache writes the template files to disk, only that user (or group?) has permission to write to the files. So I can open them in my editor, but cannot save any changes. Any ideas?

  • #26 / Feb 21, 2008 1:17pm

    louis w

    450 posts

    Updated file.

    This should fix file permissions. If you are having problems, delete the templates files and re-export.

  • #27 / Feb 21, 2008 1:23pm

    Jamie Poitra

    409 posts

    Louis,

    So the gist of this is that it exports from the DB to multiple flat/txt files at a time and vise versa?  Instead of the one file at a time deal like we normally have?  Trying to understand what the purpose is.  😊

    Jamie

  • #28 / Feb 21, 2008 1:44pm

    louis w

    450 posts

    Hi Jamie.

    You have pretty much hit the nail on the head. This allows you to mass export all your db templates as files. Also it will let you import them back into the db.

    If you have EE set up for templates as files, it will periodically check the external file template to see if it should update the db. Problem with this is when you are working on a page and need to see immediately the results you would have to manually save each one in EE. This will import them all.

    Basically it helps to speed up development time when dealing with template files.

  • #29 / Feb 21, 2008 4:06pm

    tbritton

    714 posts

    To make all of your templates into “save template as file” types of templates at once, the template2file module is an excellent compliment and companion to this template_files module. (unless the same functionality has been added in one of these new releases???)

    I discuss some other ideas in this thread here for editing your files “beyond the browser edit box”.

    Terry

  • #30 / Aug 24, 2008 8:27pm

    FrankJohnson

    150 posts

    I can’t seem to get the “import” part of this module to work. I’ve been able to export templates, but then when I change them in Dreamweaver, reupload them to the same directory, and try to use the Import function of the module, I get a message for each one which says, “No changes made, file does not exist.”

    Any thoughts on why this might be happening? I’m hoping the module developer is still monitoring this thread.

    Thanks!
    Frank

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases