Demo Persona Switch SkinObject

The Demo Persona Switch SkinObject injects a CSS-changeable footer bar that overlays the page in DNN when a user is logged in. By default, it allows you to display their profile picture, bio, and display name. However, it is templated so that you can change the HTML and use any other token that you'd like.

This version of the SkinObject allows you to click on the listed personas and automatically login as them. Gone are the days where you need to waste time logging off and logging back on during a demonstration.

demo-persona-switch-example.png

Getting Started

I think I made this super simple for you...
  1. Install DNN 07.06.06 or newer
  2. Add a few users
  3. Populate their Display Name, Biography, and Photo (smaller photos work better)
  4. Install the SkinObject in DNN
  5. Add it to your skin

Profile Properties to Set

The default properties you should set include Display Name, Bio, and Photo. Others can be used if you edit the template.

This requires that you properly set the visibility of the profile properties that are showing in order to have the desired effect. This is especially true if you choose the modify the template and/or use custom profile properties.

How to Use in Your Skin

First, download and install this SkinObject the same way that you would install any Module or any other extension in DNN.

Next, copy and paste the following code into your DNN skin.

ASCX Skins
<%@ Register TagPrefix="wns" TagName="DEMOPERSONA" Src="~/DesktopModules/WillStrohl.DemoSO/DemoPersonaSwitch.ascx" %>
<wns:DEMOPERSONA id="DemoPersonaSwitch" runat="server" />

HTML Skins
<object id="DemoPersonaSwitch" codetype="dotnetnuke/server" codebase="DemoPersonaSwitch"></object>

Parameters

This SkinObject has two optional parameters, listed below.
  • IncludeSuperusers - (default is "false") - This parameter will include Superusers in the listed personas
  • SecurityRoles - (default is "Registered Users") - This parameter will include the users that are in the specified security roles. You can include multiple security roles by separating them with a comma.

Advanced Examples

The following examples will include Superusers and members of a security role called "Employees"

ASCX Skins
<%@ Register TagPrefix="wns" TagName="DEMOPERSONA" Src="~/DesktopModules/WillStrohl.DemoSO/DemoPersonaSwitch.ascx" %>
<wns:DEMOPERSONA id="DemoPersonaSwitch" runat="server" IncludeSuperusers="true" SecurityRole="Employees" />

HTML Skins
<object id="DemoPersonaSwitch" codetype="dotnetnuke/server" codebase="DemoPersonaSwitch">
	<param name="IncludeSuperusers" value="true" />
	<param name="SecurityRoles" value="Employees" />
</object>

How to Customize the HTML

Open the following file and create your own HTML or make any other necessary HTML-compliant changes (e.g., CSS classes). You can also open this file in the Language Editor when logged n as an Administrator or Superuser. This would be the best practice.
  • ~/DesktopModules/WillStrohl.DemoSO/App_LocalResources/DemoPersonaSwitch.ascx.resx

When using the Language Editor, log in as a Superuser or Admin and navigate to the Languages page in the Admin menu. Click the pencil to edit the Static Resource file. Navigate to the skin object as shown in the image below. When you select it, paste in your desired HTML in the box on the right and then click the Save Resource File button.

demo-persona-editor.png

Last edited Aug 1, 2013 at 12:16 AM by hismightiness, version 7

Comments

No comments yet.