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.

Linking to static content in template directory

June 20, 2010 7:18pm

Subscribe [2]
  • #1 / Jun 20, 2010 7:18pm

    twaddington

    11 posts

    Hey guys, I’m working on a client site in ExpressionEngine 2, my first EE project, and have a question.

    I would like to keep all my template files together, so that I can use source control (mercurial specifically) to track and push my changes. Unfortunately, it seems near impossible to link to static files like images within a template folder.

    I already have EE saving my templates as files, so that works fine, but what do I do with images? I would like to keep them in the same folder.

    Has anyone solved this problem?

  • #2 / Jun 20, 2010 7:36pm

    twaddington

    11 posts

    Okay, duh, I think I figured this out on my own.

    I created an “assets” directory in my template directory where I put my site images. I then had to create a .htaccess file in my assets directory to allow users to access the files.

    allow from all

    Anyone see any issues with this method?

    Thanks!

  • #3 / Jun 23, 2010 9:00pm

    Roi Agneta

    352 posts

    You can create an images folder anywhere you want, since you link to it explicitly in your CSS.

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

ExpressionEngine News!

#eecms, #events, #releases