Splash of Style...Macs, Photography, Design, and other Passions

Expression Engine: Saving Templates as Text Files

November 7, 2004 by debbie T | Expression Engine

It’s been a few weeks since I first started to familiarize myself with Expression Engine. This weekend, I decided it was time again, so I opened up my printed User Guide, and started to read.

Although I am familiar with many blogging systems, after viewing so many complex features, menus, and options, I am still a little intimidated, but excited. The system seems to have everything I need and more!

I started out simple, keeping only one weblog for now. I deleted the original blog, and created a new one from scratch for practice. I found Lisa-Jill’s tutorial on Creating a New Weblog very helpful.

I am starting with the Templates area, and I figure that the best way to learn the tags is to just jump in and study the index template, while viewing the user guide. When I created the new weblog, I created a new Template group with a duplicate of the initial template groups.

Now, I don’t want to work online constantly, so I immediately found the instructions to Save Templates to Text Files. The setup worked like a charm. Expression Engine created text files of the chosen template files.

I downloaded the new directories and files, made a test edit, then tried to re-upload the file to the server. Problems! I was denied permission to alter any file created by Expression Engine, that includes moving, renaming, deleting, editing, or changing chmod.

I posted a note on the EE help forum, which lead me to post a note to my host.

The problem, it seems, is that when PHP is used to generate or alter a file, its ownership is going to be set to “nobody”. So that means my user name didn’t have permission to alter the files since the template directories were chmod 755. The problem was corrected when my host set up a root cron job to change permissions.

Update: After trying to save additional (new) templates, I was now receiving the error: “Unable to save your template as a text file.” (note: the templates previously saved were working fine.)

Other users were also having trouble with this error as well. After thinking about it for a bit, I realized that because Expression Engine originally set the new directory to 755, and because my host was reverting the user name back to me, EE was having a problem recognizing it now. I changed permissions to 777 and saved the remaining templates. Then changed the directory’s permission back to 755.

UPDATE #2: Thanks to Chris at the Expression Engine help forum, I discovered that a recent update to EE fixed the problem I was experiencing with incorrect permissions. sigh all the hours of aggrevation could have been avoided if I just kept up to date with the new system files!

Commments are closed for this article.