Copied to clipboard

Flag this post as spam?

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


  • Brett Spencer 88 posts 259 karma points
    Nov 09, 2018 @ 17:15
    Brett Spencer
    0

    Data Type to allow editor to set default colors for site in Document Type?

    As always, on deadline. Creating a custom datatype would take up all the time I have before that deadline.

    Requirement: User should be able to set a # of approved colors at the root of the website and be able to choose from those colors when adding widgets and content.

    Tried - won't work:

    1. Out of box - color picker: won't meet this criteria because of how difficult it is to set up and would have to be created/changed with each website that copied as a template.
    2. Spectrum color picker: this is closer to what they want but there is no way for me allow for a # of colors and then use those color variables throughout the rest of the site.

    Does anyone know of a quick way to get the functionality that we get when we are setting up a new approved color data type from the included color-picker datatype? Or something similar?

    enter image description here

  • Amir Khan 1282 posts 2739 karma points
    Nov 09, 2018 @ 18:14
    Amir Khan
    0

    Could you just add an approved color picker datatype with the colors you want to the homepage of the sites and then use the selected color to add a class to the boy of the site like ?

    Thats what we do for themed sites with similar structures.

    -Amir

  • Brett Spencer 88 posts 259 karma points
    Nov 09, 2018 @ 18:20
    Brett Spencer
    0

    How do your editors easily change those colors after copying a site to start another [edit: without getting a developer involved]?

  • Amir Khan 1282 posts 2739 karma points
    Nov 09, 2018 @ 18:39
    Amir Khan
    0

    Change them as in add colors to the approved set or select from the already approved set?

    If the latter they just click the box of the color they want and it adds the class to the body, the rest is on your CSS to make it actually work.

  • Brett Spencer 88 posts 259 karma points
    Nov 09, 2018 @ 19:09
    Brett Spencer
    0

    Actually, more the former.

    Allow for a dynamic number of colors as well as be able to change the color directly from the root node or document type.

    I'm thinking of a possible solution using nested content and spectrum color picker but it's ugly and the dynamic number of colors makes it impossible to code for css and capture/place in widgets.

    Would be cool if someone already had a code block that we could use in an event that could create/change a color picker using the approach that I just mentioned. (I could write one, but again... time limit is stifeling considering I would have to research how to do this.)

  • Brett Spencer 88 posts 259 karma points
    Nov 09, 2018 @ 19:31
    Brett Spencer
    0

    So I'm going to go this route right now. Always glad to hear other ideas and collaboration.

    Add a tab "Site Colors" on website root - because site could be multi-lingual. Static number of colors: I can use the property name as it will not change. Use the spectrum color picker for each property.

    Wish I could use the above to create approved color picker but will probably just include a radiobuttonlist with the color names (light, dark, light nuetral, etc.) to any widgets or components that may need to be customized.

    current and quick solution for site colors

  • Chriztian Steinmeier 2798 posts 8787 karma points MVP 7x admin c-trib
    Nov 09, 2018 @ 22:54
    Chriztian Steinmeier
    1

    Hi Brett,

    Just chippin' in, as I've recently done something very similar - I ended up using this Color Input property editor by Niels Lyngsø and a combination of individual nodes in a ListView and a nuPickers XmlRadioButton Picker with a Custom Labels macro.

    Here's a couple of screenshots:

    Color Input Property Editor

    ListView

    Custom Labels

    XmlRadioButton Picker

    Feel free to ask more details if you like,

    /Chriztian

  • Brett Spencer 88 posts 259 karma points
    Nov 15, 2018 @ 15:43
    Brett Spencer
    0

    Hi Chriztian. Thank you for the idea.

    I like the ability to create a # of colors.

    It also looks like you were able to read those colors into a reusable doc type.?

    So asking more details here: how did you get from creating what looks like a nested content property for choosing colors to a customized color radiobuttonlist that reads those colors? Can that be a data type used in multiple doc types? How does the macro play in to customize the labels? I am also assuming that the nupickers radiobuttonlist allows for the radiobuttons to be horizontal.

    Ok... so typing and thinking here as I haven't used these specific tools:

    1. create the color data type somehow.
    2. create a list of nodes of each color, not necessarily nested content but it does seem like it could work.
    3. use nupickers to create a doc-type that chooses the colors wanted in the radiobuttonlist?
    4. ? render the list with the custom labels?

    Yup, I need help!

Please Sign in or register to post replies

Write your reply to:

Draft