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.

Questions about images and templates

July 08, 2007 2:45pm

Subscribe [5]
  • #1 / Jul 08, 2007 2:45pm

    lerva

    45 posts

    Just bought EE and so far I love it.

    I have a few questions that I didn’t find from User Guide, Wiki or searching these forums (I’m sure somewhere there is answers to my questions, so you can redirect me right away 😊).

    First one is about templating. I created first static html + css and now I’m making EE template from it. I am using embed tags in it (I was little lost because all examples and default template starts every time with html declaration), and everything works fine.

    But how should I handle images that belong to template? I’m fine using ftp, since these are static images that doesn’t chance. And now I’m talking about background images in css. I guess it’s fine to put images where ever I want? But can I use relative paths in my css? Where does my css template actually is?

    I need some help with weblog images too. I need one image to be something like “Title image” of entry. So ideal would be, that there is one field that is called “Upload title image” and that’s all. Then I could use that image in my template.

  • #2 / Oct 31, 2008 12:08pm

    aaronvegh

    9 posts

    I’m brand new to EE, and this is a question I have as well. It must be a really obvious answer, because it doesn’t appear in any of the documentation. Surely there’s a best practice for storing template images? Anyone?

  • #3 / Oct 31, 2008 12:40pm

    aaronvegh

    9 posts

    I found the answer myself. For others looking for this—I can’t believe this isn’t documented ANYWHERE!!!—this is what I did:

    1. Create a directory in the root images folder: /images/interface
    2. Put all my template images in that folder.
    3. In my templates, I reference the images using this convention:

    {site_url}images/interface/logo.png

    This should really be mentioned somewhere, in the Template section of the User Guide. Just my $0.02.
    Thanks,
    Aaron.

  • #4 / Mar 09, 2009 1:07am

    Nick Gascoigne

    14 posts

    Thanks this is great. I was looking for the same answer for an hour, I couldn’t find any documentation for {site_url}.

    The problem I was having was my themes folder was being appended after the index.php which resulted in broken image links. {site_url} fixes the problem.

  • #5 / Mar 09, 2009 1:20am

    grrramps

    2219 posts

    Just remember that for XHTML and CSS graphics you can place them anywhere you want, so organization is up to you. For entry graphics, there are a few common ways to handle them. Two that I use frequently:

    1) upload to specific directory (again, you can choose where, just make sure permissions are set) and embed within the entry.

    2) create a custom field and upload graphic to a specific directory, but place the link in the field, then embed the field within your XHTML.

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

ExpressionEngine News!

#eecms, #events, #releases