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.

Can I ftp upload my templates/files instead of using EE control panel?

August 11, 2007 6:00pm

Subscribe [7]
  • #1 / Aug 11, 2007 6:00pm

    django6

    124 posts

    If I want to use another html/css editor instead of the one that comes with EE, can I then just upload the files with ftp? I can’t find the file structure for the templates—they seem to be hidden.

    The other reason I’d like to do this is because I want to upload a swfobject.js file that is compressed. So I’m not sure if it works to create a new js template and cut and paste the compressed data into it—which is what I’ve been doing with my html/css code.

    So, how do you recommend adding existing .js and .swf files to my file structure and is there a recommended place to keep these files?

  • #2 / Aug 11, 2007 7:19pm

    Ryan Irelan

    444 posts

    All of the templates have to created in the EE control panel first, however you do have the option of saving those out as files and editing them. Unfortunately, you cannot upload files and have EE see them as templates. However, if you create the template in the control panel, you could replace the file it creates with yours and EE will see it.

    You can upload any assets like images, js files, etc. normally through FTP. I would create a js directory at the site root (or inside the cp dir) to store those items. You just link to them normally.

    Hope that makes sense.

  • #3 / Aug 11, 2007 7:45pm

    sm9

    352 posts

    I do just what Ryan has described and use Coda to save changes straight to the server. Working like this, you don’t even have to log into the control panel, which is nice.

    You can see step by step help on how to do this here:

    http://expressionengine.com/docs/templates/flat_file_templates.html

    Ste

  • #4 / Aug 12, 2007 11:59am

    Robin Sowell

    13255 posts

    The CSS gurus know this better than I do!  Yep- once you’ve created the template in EE?  It’s no problem to edit via an external application.

  • #5 / Aug 12, 2007 12:48pm

    django6

    124 posts

    Maybe I’m misunderstanding, but I can’t seem to find my templates in the ftp file tree.

    Here’s what I do:
    1. create a template group in the control panel and set it as the main site template group
    2. create an index.html web page in cp
    3. ftp to the site

    I can’t find my index.html file anywhere. Should I have access to it thru ftp or is it hidden?

    I can, as was suggested, create a folder (javascript and flash) where I can upload my javascript and .swf files, but I don’t see how to create a file inside these folders from the templates section of the EE control panel.

  • #6 / Aug 12, 2007 1:12pm

    Robin Sowell

    13255 posts

    Double check the docs on saving templates as files- you’ll need to create/chmod a folder to store them in- and then on your ‘Templates’ page, go into ‘Global Template Prefs’ and specify the full path to the file- and turn ‘save as text files’ to ‘Yes’.  Then you’ll want to save each template you want to edit as a text file- and when you do, make certain that ‘save as text file’ is checked.  At that point- you should be able to see the files in your specified directory via ftp.

    Make sense?

  • #7 / Aug 12, 2007 3:57pm

    django6

    124 posts

    Yes, I do think that makes sense. thanks.

    Do I first have to create the template normally, say, create a file called homepage and choose html as it’s format. Then select save as text. So it’s really creating two files behind the scenes—homepage.html and homepage.txt ?

    If this is the case, if I upload a new homepage text file, does it automatically update the homepage.html?

  • #8 / Aug 13, 2007 1:04pm

    Robin Sowell

    13255 posts

    You lost me a wee bit on that one.  What happens, EE stores the templates in the database by default.  If you set it up so that it stores them as text files?  Then when you save the template, it will save a copy of it to the folder you specified.  So- there’s just the one text file for each template you save.  Once that happens, you can edit the text file that was created via your regular editor.  So- 1 text file per template is what you end up with.

  • #9 / Aug 13, 2007 3:19pm

    django6

    124 posts

    When you normally set up a template, you do it thru the control panel and choose its format ...html, css, xml, etc.

    I assume that at some point before executing the code the files have to be correctly defined as html, css, xml, etc.

    So if I define all of my files as text files, won’t that mess up how EE is able to determine the kind of data that is contained in that text file or doesn’t that matter? Maybe it doesn’t care about the .txt or .html extensions and only reads the doc type tag inside the file??
    But that doesn’t make sense to me since EE clearly asks you to choose the file type when you define a new template.

  • #10 / Aug 13, 2007 3:34pm

    Lisa Wess

    20502 posts

    The template type does not effect the saved files, it is for sending the correct headers to the software reading the template.

  • #11 / Aug 13, 2007 4:08pm

    django6

    124 posts

    So are you saying I can just save all my templates as text files and everything in EE will function the same?  I’ll try it and get back.

  • #12 / Aug 13, 2007 6:38pm

    Kenn Christ

    26 posts

    Any files you’ll be using are text files. Regardless of their contents or extension, they’re all ASCII text.

  • #13 / Aug 15, 2007 8:28am

    laurentsj

    23 posts

    i’m having some problem Saving Templates to Text Files

    Gone through the drill, set folder to 777 etc…

    i’m on MT with server path as /var/www/vhosts/websemantique.com/httpdocs/system/template_files/

    when updating the save, i get

    Unable to save your template as a text file

    ????

  • #14 / Aug 15, 2007 11:26am

    Robin Sowell

    13255 posts

    Try this- in the site template group, create a template called ‘test’- in the preferences, turn php parsing on.  See what happens if you paste:

    <?php
    global $PREFS;
    
            if ($PREFS->ini('save_tmpl_files') == 'n' OR $PREFS->ini('tmpl_file_basepath') == '')
                                   {    
                echo 'no path
    ';
               }
       
               $basepath = $PREFS->ini('tmpl_file_basepath', TRUE);
                  
            if ( ! @is_dir($basepath) OR ! is_writable($basepath))
            {
                echo 'no write
    ';
            }
            
            $basepath .= 'site';
            
            if ( ! @is_dir($basepath))
            {
                if ( ! @mkdir($basepath, 0777))
                {
                    echo 'no sub
    ';
                }
                @chmod($basepath, 0777); 
            }
    
            if ( ! $fp = @fopen($basepath.'/test', 'wb'))
            {
                echo 'no open';
            }
    
    ?>

    I’m not dead sure on some of it- but hopefully it will give us a hint as to where it’s breaking.  May be an ownership issue.

  • #15 / Aug 16, 2007 4:27am

    laurentsj

    23 posts

    Hi Robin

    I pasted and saved your template and went to “view rendered template”

    i get a “no open” message

    ??

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

ExpressionEngine News!

#eecms, #events, #releases