Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 939 posts 2574 karma points
    May 27, 2011 @ 10:57
    Claushingebjerg
    0

    accessing approved color prevaules with xslt

    Is there a way to use approved color prevaules through xslt?

    I have 5 predefined colors on the datatype i would like to make use of, but i dont want to add them to a document type, as the user shouldnt have acess to the selection

    Can i access the values throught XSLT. And how?

     

  • Fuji Kusaka 2203 posts 4220 karma points
    May 27, 2011 @ 11:36
    Fuji Kusaka
    0

    Hi,

     

    You can do that by using css instead and adding them in a datatype and user can easilyt access it from the Content itself.

     

     

  • Claushingebjerg 939 posts 2574 karma points
    May 27, 2011 @ 12:27
    Claushingebjerg
    0

    To clarify. I dont want the user to be able to select a color.

    i want to access the "approved color" datatypes prevalues from xslt.

  • Fuji Kusaka 2203 posts 4220 karma points
    May 27, 2011 @ 12:30
    Fuji Kusaka
    0

    Am confused so who will access the Colors?

    Why not just create a new user and just dont give it access to this part

     

    //fuji

  • Claushingebjerg 939 posts 2574 karma points
    May 27, 2011 @ 12:35
    Claushingebjerg
    0

    Ok, so to paint the whole picture.

    I want to render a random background-color on a div. So i would create the color values in the dataype, and then select it randomly with xslt. 

    Just thought it would be real easy if there was an xslt way to access the datatype without it beeing defined on a document type

  • Fuji Kusaka 2203 posts 4220 karma points
    May 27, 2011 @ 12:41
    Fuji Kusaka
    0

    I did the same thing for a client, they wanted to be able to change the color of their background through their Umbraco backoffice so as to customize their homepage with predefined color scheme.

    What is you create and XSLT with uploaded images? then you just insert the macro which will load the background images but you can make the images load randomly with javascript.

    That can be done as well.

  • Claushingebjerg 939 posts 2574 karma points
    May 27, 2011 @ 13:02
    Claushingebjerg
    1

    Allright, so since it doesnt exactly seem to be possible, and since i dont want the user to touch the colors anyway, i went the javascript way:

    <script type="text/javascript">
    <!--
    var r_text new Array ();
    r_text[0"#00a4e3";
    r_text[1"#41ad49";
    r_text[2"#f15d22";
    r_text[3"#d2232a";
    r_text[4"#97396e";
    var Math.floor(5*Math.random())
    document.write('<div id="subNavigation" style="background-color:' r_text[i';">');
    //-->
    </script>
Please Sign in or register to post replies

Write your reply to:

Draft