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.

EE Tags in CSS Template Not Parsing

August 24, 2012 6:18pm

Subscribe [2]
  • #1 / Aug 24, 2012 6:18pm

    The Glenn Group

    38 posts

    I have a CSS template called global_css.  It is rendering some css classes dynamically.  Here’s a snippet to show what I’m referring to:

    {exp:channel:entries channel="personal_blog" dynamic='off' disable="categories|member_data|pagination"}
      .bio_header_{personal_ee_username} {
        position: absolute;
        top: 0;
        left: 0;
        width: 960px;
        height: 270px;
        background: url('{personal_header_image}') no-repeat 0 0;
      }
    {/exp:channel:entries}

    I’m generating this css class dynamically for each user.  The above code works just fine on one site…but the actual EE tags are showing up on the client side on another site.  Is there a setting I might be missing to ensure that the EE tags get parsed?

  • #2 / Aug 27, 2012 10:17am

    Kyle Cotter

    730 posts

    Hi The Glenn Group,

    Are you loading the stylesheet via the {stylesheet} tag?

    If you are, then ExpressionEngine tags will not parse. The documentation makes note that using the {stylesheet} tag doesn’t parse ExpressionEngine tags for performance reasons.

    If, however, you use the {path=""} tag to load your stylesheet, it will parse the tags in the stylesheet.

    Does that make sense?

    Thanks!

  • #3 / Aug 27, 2012 11:47am

    The Glenn Group

    38 posts

    Thanks for the reply!  I am using {path=""} to load the stylesheet.  Here’s what it looks like:

    <link href="{path='?css=incl/css_globals'}" rel="stylesheet" type="text/css" media="screen" />
  • #4 / Aug 27, 2012 11:50am

    The Glenn Group

    38 posts

    I just figured it out.  I got rid of the ?css= part and it works.  Now I’m calling the stylesheet like this:

    <link href="{path='incl/css_globals'}" rel="stylesheet" type="text/css" media="screen" />
  • #5 / Aug 27, 2012 3:07pm

    Kevin Smith

    4784 posts

    Glad you were able to figure it out, The Glenn Group! If there’s anything else we can help with, just let us know!

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

ExpressionEngine News!

#eecms, #events, #releases