Copied to clipboard

Flag this post as spam?

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


  • trfletch 598 posts 604 karma points
    Jan 11, 2010 @ 12:18
    trfletch
    0

    Restricted access to stylesheets

    I'm sure I have posted or seen a post about this before but I cannot seem to find it. My customer wants to have access to stylesheets in Umbraco but I am reluctant to give them access to the whole settings section or in fact to the whole of the stylesheets. I was just wondering what options I have to allow them to change styles.

    The solutions I thought of was to have an XSLT that calls in a CSS file last in my Master template, the end user could then create a CSS file that overides any of the sites CSS and upload it in Umbraco.

    The other option was to have text area property on a document type that again user a macro was called directly into the Master page, this would mean the Umbraco user write CSS in the text area and this would be applied in the master template.

    The ideal solution would be to allow the user to access only the Stylesheets section of the Settings section, or alternatively create a custom Section called Styles that just shows stylesheets for a specific folder in the site structure (for example just shows the contents of a folder called css2 that allows users to modify some style sheets in the same way that the stylesheets section does). Any ideas people?

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jan 11, 2010 @ 12:22
    Aaron Powell
    0

    You can't restrict the items in the Settings application, so what I'd do is create a custom application which just loads the Stylesheets tree (you should be able to just point the DB to that tree class) and then give them access to that application.

  • trfletch 598 posts 604 karma points
    Jan 11, 2010 @ 12:40
    trfletch
    0

    Thanks for the quick reply, I thought that might be the best solution although I would like if possible to create a custom section and point it to a separate stylesheet folder that works in the same way as the current stylesheets area so that they can't mess up the current styles. How difficult is this likely to be?

  • trfletch 598 posts 604 karma points
    Jan 11, 2010 @ 15:31
    trfletch
    0

    I have now created a custom section that just shows the Stylesheets node, how would I go about creating a new stylesheet node that works in the same way but instead of getting and modifying files from the "css" folder it modifys files from another folder such as "css2"? I assume there is some sort of usercontrol somewhere that I have to modify?

  • trfletch 598 posts 604 karma points
    Jan 14, 2010 @ 15:26
    trfletch
    0

    Any suggestions on this one? I just want to know where the code that tells the loadstylesheets part to look in the CSS folder so that I can see if I can make a copy of this and change it to a different folder.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 14, 2010 @ 20:31
    Dirk De Grave
    0

    Can only suggest to download the core source from Codeplex and check how things are handled. I'm pretty sure an exact copy will almost work as is (besides changing the folder names of course)

     

    Cheers,

    /Dirk

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jan 14, 2010 @ 23:09
    Aaron Powell
    0

    You can't point it to a new folder without a lot of work. The reason is that the loadStylesheets tree uses the Stylesheet API which is designed to read from the css folder. So you would have to:

    • Create a custom implementation of the Stylesheet class, modifying where the CSS files are read from
    • Create a custom tree and make it use the 'new' Stylesheets class
    Essentially you'd be making your own custom application and tree.
    You're better off putting the stylesheets you don't want people to access into a different folder and leaving the ones to be Umbraco-editable in the CSS folder.

  • trfletch 598 posts 604 karma points
    Jan 18, 2010 @ 11:10
    trfletch
    0

    Hi Slace,

    Thanks for the response, that was the other option I was thinking off, moving the other stylesheets out to another folder.

Please Sign in or register to post replies

Write your reply to:

Draft