Copied to clipboard

Flag this post as spam?

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


  • Bijesh Tank 192 posts 419 karma points
    Aug 16, 2012 @ 16:57
    Bijesh Tank
    0

    Different homepage layout for members

    Hi,

    Wanted to get some ideas on how to implement a different style of homepage depending on the type of member that logs in. 

    For example, I have 2 types of users, lets call them Manager and User. When either of these types of user logs in, they effectively get redirected to the same homepage (e.g. www.domain.com/home.aspx) but the content will be different - more specically I have a tab on the homepage that uses DAMP to display different hotspot images and sort order.

    What would be the best approach to display the different content to the logged in user? I want to avoid creating multiple home pages as the number of user types will grow.

    Currently using the standard Umbraco membership provider as a proof of concept but then migrating to a custom provider after that. 

    Using Umbraco 4.8.1.

    Any help much appreciated!

    Bij.

  • Tom Maton 387 posts 659 karma points
    Aug 16, 2012 @ 19:12
    Tom Maton
    0

    What about having templates aassigned to member types with specific content for each eg

    userTemplate
    managerTemplate

    then append to the URL "?alttemplate=userTemplate" this should load that specific template (well know it use too)

    In the membership you could assign a template to the member with a custom datatype.

    Hope that helps.

    Tom

  • Bijesh Tank 192 posts 419 karma points
    Aug 17, 2012 @ 10:11
    Bijesh Tank
    0

    That's an interesting solution. However, the number of member types can grow and I want to try and avoind creating multiple templates, i.e. trying to take out as much time as I can during setup of a new member type. I want to try and leave the setup as much as possible with content writer.  What I'm trying to show is a set of promotion boxes on the homepage for different members so the layout is the same, just that the type of promotion and order would be different.

    One thing I was thinking of was something like this:

    Homepage
    -- Homepage Promos
    ---- *Promo 1
    ---- *Promo 2
    ---- *Promo 3 

    * The "Promo (x)" are effectively content stubs for the homepage and restricted by public access. The content editor can determine which type of promotion will be shown to the member.  

    I guess my question is, would something like this be ideal? Is it possible to pull in a content stub (Promo (x)) into the homepage and it pull in the correct one according to the member type?

    Cheers,

    Bij

  • Tom Maton 387 posts 659 karma points
    Aug 17, 2012 @ 10:24
    Tom Maton
    1

    What about about assigning tags using the tags manager to the promos which correspond to the membertype.

    eg member = Manager, tag = Manager

    That way the only thing you need to update is the tags assigned to the promo and call all the promos with the tag Manager

    Tom

  • Bijesh Tank 192 posts 419 karma points
    Aug 17, 2012 @ 13:41
    Bijesh Tank
    0

    Not a bad idea, I'll have a look into this one.

    Is there a good package to handle with tags? Or use just a textstring property (or similar) to manage?

  • Tom Maton 387 posts 659 karma points
    Aug 17, 2012 @ 15:01
    Tom Maton
    0

    there is allready tags datatype built into umbraco 

    else this is a good package i've used before http://our.umbraco.org/projects/backoffice-extensions/sniper-systems-tags-control

  • Bijesh Tank 192 posts 419 karma points
    Aug 23, 2012 @ 12:02
    Bijesh Tank
    0

    I started using the tag approach but spec changed and used public access permissions instead. I used the same structure as mentioned in my post above and used razor to determine which promotion should show

    @using DigibizAdvancedMediaPicker
    @using umbraco.MacroEngines                                                     
    @inherits umbraco.MacroEngines.DynamicNodeContext                                          
    @{ 
    
        var promoBlocks = @Model.AncestorOrSelf(1).DescendantsOrSelf("HomepagePromoBlock");
    
        foreach (var promo in promoBlocks)
        {
            if (promo.HasAccess())
            {    
                if (promo.hotspots != null)
                {
                    var mediaIds = promo.hotspots.Split(',');
    
                    foreach (string mId in mediaIds)
                    {
                        dynamic mediaItem = new DynamicMedia(Int32.Parse(mId));
                        dynamic hotspotImage = new DynamicMedia(Int32.Parse(@mediaItem.hotspotImage));
    
                        <a href="#" title="Hyperlink"><img src="@hotspotImage.umbracoFile" alt="image" /></a>
                    }
                }
                return;
            }
        }
    }
  • 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