Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rachel Skuse 88 posts 118 karma points
    Feb 24, 2010 @ 16:57
    Rachel Skuse
    0

    Specify a node id in external css

    Hi,

    I was wondering if it is possible to specify a nodeid in an external css file - I have tried the following but I'm guessing it doesn't work as ti doesn't know which doctype to use?

        background: url(<umbraco:Item field="umbracoFile" nodeid="[#homeBanner1]" runat="server"></umbraco:Item>) no-repeat;

     

    Thanks,

    Rachel

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 24, 2010 @ 17:20
    Dirk De Grave
    0

    hi Rachel,

    Most people tend to keep css related images (those that are used for layouting) in a /images folder, not stored on doc level or in media section.

    If you still want it to be dynamic, put this snippet in your template (using inline styling), so it gets *replaced* by the document's value at runtime.

     

    Cheers,

    /Dirk

  • Rachel Skuse 88 posts 118 karma points
    Feb 24, 2010 @ 17:54
    Rachel Skuse
    0

    Thanks, I do usually keep my css images in a media section but for 3 particular banners on my website, I need them to be backgrounds and they are likely to change regularly hence my needing to specify a nodeid.

    Could you possibly post the snippet that you refer to above?

    Many thanks,

    Rachel

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 24, 2010 @ 18:42
    Dirk De Grave
    2

    Rachel,

    Just put your code in template using syntax:

     

    <style type="text/css">
    background: url(<umbraco:Item field="umbracoFile" nodeid="[#homeBanner1]" runat="server"></umbraco:Item>) no-repeat;
    </style>

     

    Hope this helps.

    Regards,

    /Dirk

     

  • Rachel Skuse 88 posts 118 karma points
    Feb 25, 2010 @ 10:48
    Rachel Skuse
    0

    Ah, sorry, I see what you mean now! Thanks very much.

    Rachel

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies