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.

Double .css extensions in templates

February 24, 2011 6:56am

Subscribe [3]
  • #1 / Feb 24, 2011 6:56am

    Mark Jackson

    60 posts

    Hello

    I’m just getting into EE2 but I’m stuck.

    I’ve created a templates directory called “assets” outside of the system folder and set a path to it.

    I create a new template group called “style”. I then add a template to the group called “master” (note no .css extension) and add css rules to the file.

    On my server the file appears in /assets/default_site/style.group/master.css (with a single extension).

    In my home page index template the call to the stylesheet is

    <link rel="stylesheet" href="{stylesheet=style/master.css}" media="screen, projection">

    but the style sheet is never applied.

    If I edit the template “master” in the Template Manager and add an extension “.css”, the style sheet is called correctly.

    However, the file on the server is now /assets/default_site/style.group/master.css.css with two extensions.

    Is this correct operation? If it is, then it makes editing, and more importantly, syncing the files slightly awkward, as the files have to have .css.css extensions.

    It also means that if I want to call a style sheet from within a style sheet using @import, the calls have to reflect the .css.css extension as well.

    Thoughts? Early onset madness…

    Regards,

    Mark Jackson
    Freelancer v2.1.3 Build: 20101220

  • #2 / Feb 24, 2011 8:36am

    ralph.m

    225 posts

    Your href link should just be href=”{stylesheet=style/master}”. When setting paths, you don’t ever add the extension within EE, no matter what kind of template. (For example, you don’t link to normal pages with .html, such as {title_permalink=blog/view.html}, but just {title_permalink=blog/view}. The extensions appear on your saved templates, but that’s different.

  • #3 / Feb 24, 2011 8:50am

    Mark Jackson

    60 posts

    Hello Ralph

    Now I understand. Thank you for your help.

    Regards
    Mark Jackson

  • #4 / Feb 24, 2011 9:19am

    Sue Crocker

    26054 posts

    Thanks for the assist, Ralph.

    Mark - If you run into any problems with this down the road, don’t hesitate to open a new thread based on this one.

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

ExpressionEngine News!

#eecms, #events, #releases