Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Slightly different menu for logged in users using DDR menu (showing login and logout)Slightly different menu for logged in users using DDR menu (showing login and logout)
Previous
 
Next
New Post
12/6/2012 5:56 AM
 

I have a requirement for a skin to show a slightly different menu for logged in users, this is not so much new pages but the option to login and logout.

Sounds easy right? but the placement of the links is different so in effect I need to show 2 slightly different menus. Examples below:

Normal Menu:

  • Home
  • About
  • Contact
  • Links
  • Login (link to login page)

Logged in Menu:

  • Home
  • About
  • Contact
  • Links
  • Account (replaces the "Login" link)
    • User Page 1
    • User page 2
    • Logout (logs the user out as opposed to taking them to a logout page)

So the requirements are:

  1. A login link to a login page (This can be a custom page so a simple link)
  2. Login link becomes an "Account" dropdown
  3. The logout functionality is appended to the end of the "Account" dropdown

Any thoughts and ideas/solutions on how this could be achieved?

Thanks,

Rick.

 
New Post
12/6/2012 1:14 PM
 

You should be able to easily do this with permissions. Create your page structure like this:

  • Home
  • About
  • Contact
  • Links
  • Login
  • Account
    • User Page 1
    • User page 2
    • Logout

Then set the permissions for the Login page to only unauthenticated users and set the Account page for only Administrators or Registered Users.

Note: Superusers will still see the Login page.

Another option is to still use the page structure above and then in your skin ascx, wrap it in something like this:

<div class="Skin <%= IIf(Request.IsAuthenticated, "LoggedIn", "NotLoggedIn") %>"></div>

Then just use css to hide and display elements based on the class LoggedIn or NotLoggedIn

 
New Post
12/6/2012 3:51 PM
 
Okay... so don't create a page titled "login" without login functionality, stops you being able to log in.
 
New Post
12/7/2012 5:19 AM
 

Good call on this one. I managed to create the layout using permissions alone. Couple of notes from this approach:

  • login page can't be called login.aspx if it doesn't contain an Account Login module, for some reason it stops the pop-up account login from working properly. I had to remove the new login page from the database table to get back in.
  • The Login and account pages can't have the same name because they're on the same level, so using "account" as a login page and then using "account" as a hook for the dropdown menu won't work, ended up using "Account" and "My Account".
  • The logout function need to link to logoff.aspx and seeing as this page doesn't exist in the site structure, I had to make the page a link (options found in the link type section of the page settings) to http://theDomain.com/logoff.aspx

I have thought of another option using conditional statements to check if the user is logged in and then loading a different menu depending on the state of this, but it's un-tested atm. Will update if this works depending on if my client wants to go down that route.

Thanks for the help on this one.

Rick.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Slightly different menu for logged in users using DDR menu (showing login and logout)Slightly different menu for logged in users using DDR menu (showing login and logout)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out