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 Variable for CSS

June 06, 2008 8:45pm

Subscribe [3]
  • #1 / Jun 06, 2008 8:45pm

    lebisol

    2234 posts

    In short….is there such a variable?
    Something equivalent of forum module’s

    {path:image_url}

    For now I am using

    url(./themes/site_themes/theme_name/some_img.jpg)


    Should I even bother?
    Thanks for your thoughts!

  • #2 / Jun 06, 2008 8:56pm

    Leevi Graham

    1143 posts

    In short….is there such a variable?
    Something equivalent of forum module’s

    {path:image_url}

    For now I am using

    url(./themes/site_themes/theme_name/some_img.jpg)


    Should I even bother?
    Thanks for your thoughts!

    I generally create a global template variable called {theme_path} in the admin and then use that in my templates. 😊

  • #3 / Jun 06, 2008 9:07pm

    lebisol

    2234 posts

    Thanks Leevi!
    Thought I ask before trying to create somethig that is there by default.
    I suppose the word “global” should have been a hint eh? 😊
    Thanks again!

  • #4 / Jun 07, 2008 2:16am

    Ingmar

    29245 posts

    One small caveat, though: If you use the {styleheet=} method of calling your css files, no variables (except {site_url}) will be available.

  • #5 / Jun 09, 2008 2:23pm

    lebisol

    2234 posts

    Then we are back to square one…after a few tests I also noticed that using {path:image_url} kills my CSS editor for the id or class used on.
    I suppose hardcoding url to theme folder is not that big of a deal especially since there is not way of ‘packaging’ themes with 1 click install…
    just exploring, thanks guys!

  • #6 / Jun 09, 2008 4:12pm

    Ingmar

    29245 posts

    Actually, the point I was trying to make is that you can call your css template via {path=} or just the “regular” way, and the EE variable will work. But whatever works for you, obviously.

  • #7 / Jun 09, 2008 5:09pm

    lebisol

    2234 posts

    Right, I might be little too focused on using EE tags all the time. Never the less, it is a simple solution now that I have seen it work.
    Thanks for your follow up!

  • #8 / Jun 09, 2008 5:13pm

    Ingmar

    29245 posts

    No worries 😊 There is generally more than one way to do it…

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

ExpressionEngine News!

#eecms, #events, #releases