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.

Template File Uploads?

July 05, 2007 11:50am

Subscribe [0]
  • #1 / Jul 05, 2007 11:50am

    Christian Sweatt

    281 posts

    I feel really stupid asking this as it’s probably something really simple that I’m overlooking…  This is regarding file uploads.  I checked the docs but could not find an appropriate answer.

    My web pages have numerous images that make up the templates.  How do I upload those images to my template images directory?  Do I have to FTP them, or is there a way to do this through the control panel?  I know you can create an upload directory, but how would I actually upload the image to my template files?  It seems there should be a feature under the template management tab…  Do those images even go into that directory, or do they go into the images directory in the root?

    Thanks!

  • #2 / Jul 06, 2007 9:58pm

    Christian Sweatt

    281 posts

    I suppose no one knows?  🙄

  • #3 / Jul 06, 2007 10:03pm

    Stephen Lewis

    466 posts

    Hi Christian,

    I’ve assumed you’re referring to images specified in a stylesheet, or maybe non-content managed images that reside in a template (rather than the “content”). For such images, I place everything in a sub-directory inside the main images directory, something like this:
    /images/theme_images/my_site_name/

    I have no idea if this is the “official” (or even wise) way of doing things, but it’s always worked fine for me. In terms of how I get those images there in the first place, I just FTP everything.

    Hope that helps,
    Stephen.

  • #4 / Jul 06, 2007 10:14pm

    Sue Crocker

    26054 posts

    There is a third party File Manager It allows you to manage photos without having to FTP.

  • #5 / Jul 06, 2007 11:16pm

    Christian Sweatt

    281 posts

    Thanks both of you, Stephen and Sue!!!

    So, just to be sure I’m doing this correctly…

    My templates folder is in the “core” directory.  Let’s call my template group “primary”.  I created an images folder within “primary”, and to link to those images I would simply call up “images/image_name.jpg” in my templates for that group?  Is that correct?  Or do I handle the link to the image differently?

    Thanks again to both of you.  I do wonder why an “out-of-the-box” upload/file manager for templates was not included with EE…  It seems to me for it to make sense to be able to upload images for your templates (such as header/footer banners).

    Cheers!

  • #6 / Jul 06, 2007 11:19pm

    Christian Sweatt

    281 posts

    ***I’ve also noticed that none of my images are working in the EE documentation.  I’m looking at the one’s hosted on the EE server.  Any idea what’s going on?  The page I’m looking at right now is at http://expressionengine.com/docs/quick_start/step_2.html  None of the images work.  Just wanted to bring that up***

  • #7 / Jul 07, 2007 8:03am

    Stephen Lewis

    466 posts

    Hey Christian,

    I think there may be some confusion here. An example might help (both of us). Let’s say the root of your site has the following structure:

    /images
    /index.php
    /license.txt
    /system
    /path.php
    /themes

    If I’m saving my templates as external files for more convenient editing (which I do, and which it sounds like you’re doing), I’ll create a folder within the /system directory called “templates”, and within that a folder with my site name (once again, I have no idea if this is the recommended way of doing things).

    So it looks something like this:
    /system/templates/my_site/

    What happens inside the “my_site” directory entirely depends on how I’ve got my template groups set up in EE. For the sake of argument, let’s say I’ve got a template into which all my CSS is placed (“my_css”). That template resides in a template group (“inc”) containing a bunch of common site elements. So in the Templates tab I’ve got a template group “inc”, containing a template “my_css.”

    I’ve saved the template out as a file, so the directory structure on my server looks like this:
    /system/templates/my_site/inc/my_css

    I then place all the images that are referenced in the CSS inside the /images folder, as follows:
    /images/theme_images/my_site/

    If I want to reference an image in this CSS file, I just go back to the root, for example:

    #thing {background-image : url(/images/theme_images/my_site/my_image.jpg);}

    I hope that explanation hasn’t confused you more than ever.

    Stephen

  • #8 / Jul 07, 2007 8:28am

    Sue Crocker

    26054 posts

    ***I’ve also noticed that none of my images are working in the EE documentation.  I’m looking at the one’s hosted on the EE server.  Any idea what’s going on?  The page I’m looking at right now is at http://expressionengine.com/docs/quick_start/step_2.html None of the images work.  Just wanted to bring that up***

    Thanks for reporting that. Lisa reported it yesterday.

  • #9 / Jul 07, 2007 8:34am

    Sue Crocker

    26054 posts

    My templates folder is in the “core” directory.  Let’s call my template group “primary”.  I created an images folder within “primary”, and to link to those images I would simply call up “images/image_name.jpg” in my templates for that group?  Is that correct?  Or do I handle the link to the image differently?

    Thanks again to both of you.  I do wonder why an “out-of-the-box” upload/file manager for templates was not included with EE… It seems to me for it to make sense to be able to upload images for your templates (such as header/footer banners).

    If you were to use the FileManager link I sent you, you would either need to use the existing file directory (normally /images/uploads) or you’d create another one to go with your /core/primary/images folder.

    If you put them there, you’d do something like this:

    /core/primary/images/banner.jpg

    You path from the root.

    or if you used the default file directory, it would be:

    /images/uploads/banner.jpg

    Does that help?

  • #10 / Jul 07, 2007 1:17pm

    Christian Sweatt

    281 posts

    WoooHoo!  Thanks to both of you.  I finally got it to work!

    *Stephen:  Yes, I am saving my templates as files, only because it makes sense to me.  I just can’t wrap my brain around saving the templates with the default setting, then going into the server directory and not seeing any of my site files there…  I’m weird, I know, but it makes me feel more comfortable.  😛

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

ExpressionEngine News!

#eecms, #events, #releases