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.
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.
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?
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
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
Hi Rich
Aaah...ok, in that case I'm not sure either but your suggestion sounds logic...:)
/Jan
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.
Many thanks for replies... curiosity satisfied.
is working on a reply...