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 a stylesheet template.

April 07, 2011 12:15am

Subscribe [4]
  • #1 / Apr 07, 2011 12:15am

    rorourke

    113 posts

    Okay, so this works fine:

    <link rel="stylesheet" href="{stylesheet=css/lib}">

    It generates a URL in the source i.e. http://localhost:8888/index.php?css=css/lib.v.1302145632, which does the trick.

    But, when I view my lib.css, which links to multiple stylesheets via @import it is just showing the stylesheet tag. Not converting it to a URL to the file. I’m trying this:

    @import url("{stylesheet=css/core}");

    All my css files are in a template group, called css. So “css/lib.css” “css/core.css” “css/reset.css” “css/ie.css”, etc..

    Any thoughts? Thanks!

  • #2 / Apr 07, 2011 12:06pm

    blendimc

    150 posts

    I think this addresses your issue.

    As per the documentation - http://ellislab.com/expressionengine/user-guide/templates/globals/stylesheet.html

    Pages that are linked through the stylesheet tag will not be parsed as normal Templates. ExpressionEngine Tags and PHP inside the Template will not be parsed. The Template will be sent exactly as it is stored. This means that your CSS files will be much more light-weight as they do not require the use of ExpressionEngine’s template parser.

  • #3 / Apr 07, 2011 4:49pm

    Brandon Jones

    5500 posts

    Thanks blendimc.

    rorourke, if you need tags to be parsed you can set your CSS templates to be of the standard webpage type. Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases