I have created an EE template which is a stylesheet that enables the user to change the background image for the page by updating a channel entry.
I have the code working using an id on the body tag but I am wondering if it is possible to use a conditional that looks at segment 1 and changes the style on the fly, here is my code that works using an id:
{exp:channel:entries channel="background_images" url_title="home-background" limit="1"}
body#home { background: url({page_background_image}) no-repeat fixed; }
{/exp:channel:entries}If I wrap it in a conditional it does not work:
{if segment_1 == ""}
{exp:channel:entries channel="background_images" url_title="home-background" limit="1"}
body { background: url({page_background_image}) no-repeat fixed; }
{/exp:channel:entries}
{/if}My question is do conditional statements work in stylesheets that are saved as templates and output using the path tag, or am I just missing something?
Thanks
Gareth