Copied to clipboard

Flag this post as spam?

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


  • Phil 12 posts 32 karma points
    Mar 27, 2011 @ 19:03
    Phil
    0

    umbraco.library:RegisterStyleSheetFile

    Came across this in a start pack file:

    <xsl:value-of select="umbraco.library:RegisterStyleSheetFile('StarterkitGallery', '/css/StarterkitGallery.css')"/>

    I understand the 'StarterkitGallery' parameter is a unique name, but what is it actually used for?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 12x admin c-trib
    Mar 28, 2011 @ 11:08
    Jan Skovgaard
    0

    Hi Phil

    What the above extension does is adding the stylesheet file in the <head> section of the rendered html markup instead of it just being placed in the html code somewhere, which would be a bad practice and pretty messy.

    It also makes it possible to ensure the CSS is only included on those pages where this macro is used.

    I hope this answers your question :-)

    /Jan

  • Rich Green 2246 posts 4008 karma points
    Mar 28, 2011 @ 11:34
    Rich Green
    1

    Hey Jan,

    I think Phil was wondering what the first parameter of RegisterStyleSheetFile() does.

    In VS it's just a string with the name of "key", how it gets used I don't know to be honest?

    Rich

  • Jan Skovgaard 11280 posts 23678 karma points MVP 12x admin c-trib
    Mar 28, 2011 @ 11:42
    Jan Skovgaard
    0

    Hi Rich

    Aaah...ok, in that case I'm not sure either but your suggestion sounds logic...:)

    /Jan

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Mar 28, 2011 @ 12:40
    Lee Kelleher
    0

    The "key" parameter is used to avoid conflicts with any other stylesheets are registered.  Not sure on the order of precedence, but the key is required.

    Cheers, Lee.

  • Phil 12 posts 32 karma points
    Mar 28, 2011 @ 14:17
    Phil
    0

    Many thanks for replies... curiosity satisfied.

  • 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