Copied to clipboard

Flag this post as spam?

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


  • André Lange 108 posts 410 karma points
    Sep 28, 2018 @ 13:53
    André Lange
    0

    Member area with different design

    I am starting to build a new website, where i would like to have a member area that has a largely different design, though sharing some elements and styling.

    I am planning on using this as the "open" part of the site: https://www.creative-tim.com/product/argon-design-system And expanding on it to better suit my needs.

    And this dashboard as a member area: https://www.creative-tim.com/product/argon-dashboard

    How would i go about having a totally new design ? the only thing shared between the two, would be some styling.

    I know this a broad question, but i am not currently able to see how i could achieve this in a single umbraco installation.

    I would love not having to make two.

    Any resources or other people who have made it before i could get inspiration from ?

  • Amir Khan 1284 posts 2741 karma points
    Sep 28, 2018 @ 15:55
    Amir Khan
    0

    You could just create a different master template for the members portion of your site.

  • André Lange 108 posts 410 karma points
    Oct 01, 2018 @ 06:51
    André Lange
    0

    Wouldn't that require that every doctype i want to use under the member section, has to be specific for the member section ? So i couldn't use it on the "open" part.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Oct 01, 2018 @ 08:01
    Jan Skovgaard
    0

    Hi André

    You should be able to switch the master template / layout for your pages setting the layout using some conditional logic in the top of your templates.

    So you have have two master templates like "Layout.cshtml" and "LayoutMember.cshtml".

    I imagine that you will also need a "Home" document type, which has a "home.cshtml" template, which inherits the "Layout.cshtml". And you also have "Home Member", which has a "homeMember.cshtml" template, which inherits the "LayoutMember.cshtml".

    Then let's say you have a textpage documenttype, which has the template "textpage.cshtml". In order to reuse the textpage under both master document types you can add some conditional logic like the following to decide, which layout should be used in your textpage.cshtml.

    OBS: This is a pseudo code example, which might not be accurate in your context - It's copied from a solution where we have a custom "baseline", which is dealing with mapping of document types etc. differently than what you get out of the box with Umbraco - So no guarantee that the code can be copied directly - But it serves as an inspirational example on how to achieve reuse of document types.

    @{
        var memberSite = CurrentPage.AncestorOfSelf<HomeMember>();
    
       if(memberSite != null){
           Layout = "path/to/your/memberLayout.cshtml";
       }
    }
    

    I hope this makes sense :)

    /Jan

  • André Lange 108 posts 410 karma points
    Oct 01, 2018 @ 08:03
    André Lange
    0

    Cool, i believe this will work ! Thank you!

Please Sign in or register to post replies

Write your reply to:

Draft