Page 1 of 1

Limited access to stylesheets

Posted: Wed Oct 13, 2010 12:06 am
by Nettie
I'm having a bit of a problem. I have to make a site, where the editor can change color on the sites links, headers and sitename (logo-text), without having access or limited access to the stylesheets.

Is it somehow possible to give the user permission to use only one specific stylesheet?

Or is it possible in some strange way to use a global content block to edit those specific styles?

If anybody has a good solution to this I would higly appreciate it :)

Re: Limited access to stylesheets

Posted: Wed Oct 13, 2010 12:23 am
by jmcgin51
yes, this is certainly possible and I have done it before.  when I get back to a computer, I'll post more specific instructions.

Re: Limited access to stylesheets

Posted: Wed Oct 13, 2010 1:31 am
by jmcgin51
here is what I did.  It may not work exactly as-is in your situation, but it should get you started...

1. create a new page template (I called mine "user_editable_css")
- the template looks like this
{process_pagedata}
{content assign="content_var"}
{literal}
    div#content2 {
        background-color:
        {/literal}
            {content block="RightDivBackgroundColor" oneline="true"}
        {literal}
    }
{/literal}
2. create a page (I used page alias = editable-css), and assign it to the template you created above.  This page will be the page that the user edits to change the selected styles (per the content blocks you put in the template).

3. in your regular page template(s), add this between the head tags:
That's it!  Now you can edit the editable-css page, and see your changes immediately on any page that uses the template(s) you modified in step 3.

Re: Limited access to stylesheets

Posted: Wed Oct 13, 2010 2:11 am
by Nettie
THANK YOU SO MUCH!!!!!

That did the trick and was exactly what I was looking for ;D

I owe you big time.........!

Re: Limited access to stylesheets

Posted: Wed Oct 13, 2010 2:16 am
by Nettie
Now i just wonder if there is a way to get rid of the tinymce content area..... ;)

Re: Limited access to stylesheets

Posted: Wed Oct 13, 2010 3:26 am
by jmcgin51
I believe you cannot get rid of the primary content block in current CMSMS versions, as some modules require that block.  In future, I think it will be optional.

You could make it one-line, but that's about as far as you can go, I think...

Re: Limited access to stylesheets

Posted: Wed Oct 13, 2010 4:41 pm
by Dr.CSS
Why not just use the {content} block, give it the label='Right Div Background Color' and online='true'?...

Re: Limited access to stylesheets

Posted: Wed Oct 13, 2010 6:06 pm
by jmcgin51
I've never used the "label" attribute - thanks Dr.!

Re: Limited access to stylesheets

Posted: Thu Feb 03, 2011 11:17 pm
by Nettie
Just found out it only works in internet explorer :(

Was a great way to give limited access to a stylesheet if it worked. I came up with a solution using global content blocks and combined with CSS as an internal stylesheet in the header. Works the same way except the user has to open a content block for each style setting.

Thanks for the suggestion though - pointed me to a solution.