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.

External CSS & Images

June 05, 2008 12:48am

Subscribe [2]
  • #1 / Jun 05, 2008 12:48am

    gladzor

    2 posts

    I’ve been trying to re-create an existing static webpage in EE Core before applying some dynamic functionality to it and I’ve been having problems accessing my css and images folder from the index page of the template group that I created in the Control Panel.

    I basically cut and pasted the existing html code into the index template with a link in the header:

    <link rel=“stylesheet” href=“css/base.css” type=“text/css” media=“screen, projection” />

    I tried putting the ‘css’ folder in the ‘introduction’ folder (containing my template group, since I saved it as a file) in the ‘templates’ folder without any success. Where should I place the ‘folder’ to be available to all template groups.

    And where should my ‘images’ folder go?

    Any suggestions would be greatly appreciated.

  • #2 / Jun 05, 2008 2:34am

    PXLated

    1800 posts

    You can put your CSS and images folders anywhere you’d like just as with a normal static site. You just need to set your paths to them correctly, as you also would with a normal static site.

  • #3 / Jun 05, 2008 3:01am

    smartpill

    456 posts

    Your best bet with external css in EE is to reference the path from site root. So if your css folder is in the main root directory, use href=”/css/base.css” instead of the relative path.

  • #4 / Jun 05, 2008 6:56am

    aftershock

    46 posts

    You can use the following tag:

    {site_url}

    like this example:

    {site_url}assets/siteimages/icons/email.png
  • #5 / Jun 05, 2008 10:59am

    gladzor

    2 posts

    Problem solved. Thank you all for your input.

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

ExpressionEngine News!

#eecms, #events, #releases