WCM 1600 Template Member/Non-Member Homepage

We've a client who has a WCM site using the 1600 template. They're looking to incorporate a homepage variation based on authorization, basically, having a Member Homepage and an Non-Member homepage.

We've tried using the 'AuthScript' code that is utilized for the Aspen themed Member site, but that 'breaks' the homepage design (gives the homepage the interior page layout), so that's not working. We've considered creating a navigational component for the MemberHome page that would not go into the navigation and a similar 'AuthScript' would be utilized to redirect if a user is logged in. The member home page would then use a different content area directory for the homepage design content, but this does not appear to be working as intended.

I'm hoping we don't have to redesign the entire site in a forest or custom master page, but that's the 'suggested' route for anything WCM these days.

Has anyone done this for a 1600 templated site?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

  You should be able to

 

You should be able to hide/show different components based on if a person is logged in or even automatically re-direct your members to the member home page when they go to the non-member home page. The basic logic to check if someone is logged in is below. Hope this helps.

if (Asi.Security.AppPrincipal.CurrentIdentity.IsAuthenticated && Asi.Security.AppPrincipal.CurrentIdentity.LoginUserId != ""){

}

Awesome! Thanks! Is this

Awesome! Thanks!

Is this just checking to see if someone is logged in? Is there a way to check to see if they have a current membership (as in they could have a record with a login, but do not have a current membership - thus they would be considered a non-member). Using this method, could we do some checking for a valid 'is member' membership type? Or base it on security groups/roles/access settings?

You would have to dig more

You would have to take the information you have (probably the login) to query another web service or the database to determine other information. The basic is-logged-in information is very general.
--
Bruce Wilson
Director, Technical Services
McGladrey & Pullen, LLP

Can USE IBO API

 

You could then create an iBO contact record if you wanted to check member type or some other information about the person logged in.

CWebUser user = CWebUser.LoginByPrincipal(HttpContext.Current.User);
CContact authContact = new CContact(user, user.ContactId);

Thanks!

That will come in handy for sure, thank you