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.

Theme Folder Url in Stylesheet

August 07, 2013 11:46am

Subscribe [2]
  • #1 / Aug 07, 2013 11:46am

    HLegge

    1 posts

    Hi, I’ve been working on my first EE project and i’m using EE Core 2.6.1 and i’ve run into a bug in the css parsing.

    When i use {theme_folder_url} it isn’t converted on other templates when linked via {stylesheet="styles/main"}

    It is parsed if you click “View Rendered Template” however if you refresh that page it reverts to normal.

    {site_url} works just fine so it’s obviously being parsed through the template parser however it doesn’t want to change this.

    Is there a way to fix this bug?

  • #2 / Aug 07, 2013 1:44pm

    Rob Allen

    3114 posts

    Welcome to the forums.

    It’s not usually(?) a good idea to use stuff from the /themes folder in the front end.

    I’d recommend either:

    1. Use a CSS “template” and use that
    2. Use an external CSS file and locate it in an “assets” folder outside of the /themes folder, eg /assets/css/myfile.css

  • #3 / Aug 07, 2013 2:16pm

    HLegge

    1 posts

    Thanks for the welcome.

    Sorry i must have been unclear. My CSS is in a template and is being called via the stylesheet tag. In the css file to link to images I’m using {site_url} currently but the images are actually in the theme folder so i was looking to change that to {theme_folder_url} however that doesn’t seem to parse properly.

    I’ve decided to move the images to an assets folder now though but i’d still like to know if a fix were possible?

  • #4 / Aug 07, 2013 2:35pm

    Rob Allen

    3114 posts

    Ah in that case just reference images like

    /myimagefolder/image.png (note the first slash!)

    and not {site_url}imagefolder/myimage.png

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

ExpressionEngine News!

#eecms, #events, #releases