Copied to clipboard

Flag this post as spam?

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


  • CodeMaster2008 151 posts 184 karma points
    May 04, 2010 @ 15:51
    CodeMaster2008
    0

    Allow user to choose between multiple "skins/themes"

    I'm not sure if i can apply the word "skin" here but it's the one I'm use to as a former DNN guy - Umbraco stole my heart :-)

    What i wanna do it is have a dropdownlist somewhere on the backend where the user/admin can change the look and feel of the website applying a different theme.

    What's challenging me is that part of the html is applied inside templates and macros and to get there I would need at least multiple versions of the same macro, one for each theme. Depending on the selected theme the right macro should be used.

    I'm not sure if it's possible or even if I'm going on the right direction and would like to hear some opinions.
    I know I could use CSS to "change the themes" and acomplish it easily however, I'm not that good in css to come out with a template that can completely change it's look and feel just touching the css.

  • Laurence Gillian 600 posts 1219 karma points
    May 04, 2010 @ 16:24
    Laurence Gillian
    0

    Have a think about doing it with CSS, you could end up with a nightmare of different macro's, etc which could become a pain to manage from version to version of the site.

    The CSS way could be for example...

    Just pass in the the 'theme' id/name into the body tag as a class.

    And then you could write additional classes which would modify the existing base template.

    Something like...

    body.themeGreen modules { background: green; }

    which if placed at the bottom on your CSS would overide/add to;

    .modules { height: x; width: x; background: red; }

    becoming

    .modules { height: x; width: x; background: red; background: green;}

     

  • Chris Dunn 210 posts 401 karma points
    May 04, 2010 @ 18:30
    Chris Dunn
    0

    Another option using the concept of css themes is to swap out the entire style sheet based on the selected theme.  In one of your macros determine the "theme" selected and add the corresponding style sheet to the header.  Kind of the CSS Zen Garden concept and used by Blog4Umbraco.

    -Chris

  • CodeMaster2008 151 posts 184 karma points
    May 06, 2010 @ 18:44
    CodeMaster2008
    0

    You guys are right, thanks a lot.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies