Addition syntax documentation?

Jul 4, 2010 at 2:18 AM

I loved the original Unload CSS skin object because it helped remove a lot of bloat from DNN's crappy defaults. I'm trying to dig into the the new features in Style Helper, but I don't I have the syntax quite right for the filtering. 

For example, I'd like to apply a filter that loads the admin css files (ribbon bar, tab strip, ect...) only if a user is logged in as an administrator—that way regular users don't have to download styles they would never use.

I did a quick test trying to remove "portal.css," which I did successfully using the standard:



However I wasn't able to get it to work using the following condition: 

<fortyfingers:STYLEHELPER ID="STYLEHELPER1" RemoveCssFile="portal.css" IfRole="Administrators"  runat="server" />

I'm sure I just have the syntax wrong. So adding a few more examples of "advanced filtering" would be greatly appreciated!


Jul 14, 2010 at 8:48 PM

What you are trying to do is remove the portal.css file unless the user is in the administrators role.

In that case you should use:

<fortyfingers:STYLEHELPER ID="STYLEHELPER1" RemoveCssFile="portal.css" IfRole="!Administrators"  runat="server" />

But there was a small bug in the skin object (if you are not logged in there is no role, so the code always returned false in the case).
I corrected that in version 01.00.01, now the code above should work..

The filtering for removal defaulted to false, the reason I did this was to allow removal of default.css (most used use case), without filtering while adding some files with filtering, but now that I think about it setting both attributes to true seems more logical...

So I changed that too..

Let me know if it works for you now..