New features
Version 3.x > New features > minilogon request View modes: 
User avatar
Member
Member
garios - 10/8/2008 11:49:26 AM
   
minilogon request
Hi!

It would be nice if minilogon webpart can have an attribute like "Show only when NOT authenticated" in the very same way currentuser webpart has under "Display Settings" something called "Show only when authenticated".
In this way both can work together, you show minilogon when the user is not authenticated and while the user is authenticated you show currentuser webpart on the same place.

- Gustavo

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/9/2008 3:58:34 AM
   
RE:minilogon request
Hi,
Thank you for your suggestion. We will try to add it in some of the next versions and also for other web parts/controls.

right now, you can use this workaround on the page where you are using the minilogon:

Please switch to the code behind and e.g. to the method Page_Load please add this code:

if (CMS.CMSHelper.CMSContext.CurrentUser.IsAuthenticated())
{
<minilogon_ID>.Visible = false;
}

I hope it makes sense and will help.


Best Regards,
Juraj Ondrus

User avatar
Member
Member
garios - 10/9/2008 6:22:11 AM
   
RE:minilogon request
Thanks for your quick response, your suggestion makes sense, but if I am only using portal engine to create my pages, which file is the code behind?
I've tried something like this in default.aspx.cs but didn't work,

protected void Page_Load(object sender, EventArgs e)
{
if (CMS.CMSHelper.CMSContext.CurrentUser.IsAuthenticated())
{
plcRoot_Layout_zoneLogin_logonminiform_loginElem_pnlLogonMiniForm.Visible = false;
}
}

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/9/2008 7:41:55 AM
   
RE:minilogon request
Hi,

In this case you need to modify the code behind of the web part (\CMSWebParts\Membership\LogonMiniForm.ascx.cs). You should create a copy of the web part as described in our dev guide to avoid the changes after upgrade - http://www.kentico.com/docs/devguide/modifying_the_design_of_standa.htm (step 1).

Now please open the cloned web part code file and find the OnContentLoaded() method and at the end of this method please add this code:

if (CMS.CMSHelper.CMSContext.CurrentUser.IsAuthenticated())
{
this.Visible = false;
}

Best Regards,
Juraj Ondrus

User avatar
Member
Member
garios - 10/9/2008 8:30:54 AM
   
RE:minilogon request
Thanks Juraj,

This is exactly what I needed and it worked!

By the way, excellent response in support for a forum!
Please keep up the good work!

Best Regards!