How to enable the signin link for user

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/15/2010 4:44:20 PM
Gravatar
Total Posts 2262

Re: How to enable the signin link for user

Hi,

Put this in your layout.master:

<portal:AutoHidePanel ID="ah1" runat="server">
  <div id="admin">
    <a id="show_hide" class="arrow left" href="javascript:toggleVisibility()"></a>
    <div id="buttons">
      <cc1:AdminOnlyLinks id="AdminOnlyLinks1" runat="server" />
      <portal:AdminMenuLink id="lnkAdminMenu" runat="server" />
      <portal:FileManagerLink id="lnkFileManager" runat="server" />
      <portal:NewPageLink id="lnkNewPage" runat="server" />
      <portal:PageEditFeaturesLink id="lnkPageContent" runat="server" />
      <portal:PageEditSettingsLink id="lnkPageSettings" runat="server" />
      <asp:ContentPlaceHolder ID="pageEditContent" runat="server"></asp:ContentPlaceHolder>
    </div>
  </div>
</portal:AutoHidePanel>

Remove these lines from your user control:

<div id="admin">
  <a id="show_hide" class="arrow left" href="javascript:toggleVisibility()"></a>
  <div id="buttons">
 

<portal:AdminMenuLink id="lnkAdminMenu" runat="server" />
<portal:FileManagerLink id="lnkFileManager" runat="server" />
<portal:NewPageLink id="lnkNewPage" runat="server" />
<portal:PageEditFeaturesLink id="lnkPageContent" runat="server" />
<portal:PageEditSettingsLink id="lnkPageSettings" runat="server" />

 

</div>
</div>

Remove the JavaScript from your user control and put it in your layout.master.

The <portal:AutoHidePanel is just a simple control that inherits from <asp:Panel, what it does is look for child controls that inherit from WebControl (like the admin links), it looks at all its child controls and if there are no WebControls with their visible property set to true then it makes it's own Visible property false. It doesn't care about the other literal html that it may contain so it doesn't matter if that stuff is visible or not, it only cares if it has at least one visible WebControl contained within it.

HTH,
Joe D.

4/15/2010 8:48:21 PM
Gravatar
Total Posts 156

Re: How to enable the signin link for user

Joe,

An enourmous thanks for all of your help.  All of this finaly makes sense and it's working flawlessly.  Sorry for bothering you guys so much with this.  It's just that I'm new to your product and have not familiarized myself with the internal set-up of all the controls, etc.

Thanks again for all the time and effort!

 

Best,
Alex

4/15/2010 8:57:21 PM
Gravatar
Total Posts 2262

Re: How to enable the signin link for user

Hi Alex,

I'm glad you got it working. I think I'm going to make a blog post out of this so others will know how to do exactly what you are doing. :-)

Thanks,
Joe D.

4/15/2010 9:12:55 PM
Gravatar
Total Posts 156

Re: How to enable the signin link for user

Joe,

This is a good idea.  I am sure quite a few people might attempt this sometime down the road and it's not as straight forward as one might expect it to be.  Here's my experience:

I did not like the default admin bar - I wanted ours to be on the side and I wanted to add quite a few more links to it. Also, I only wanted it to show up when the user was logged in.

1.  My earliest attempt was to have everything in AutoHide panel b/c I initially thought it was hidden/shown when user was logged out/in.  However, this wasn't true - it only disappeared when there were no other asp controls in it and disregarded everything else.

2.  I realized I needed to write a custom control, but decided to search the forums to see if anybody has attempted something similar - just didn't want to re-invent the wheel :).  That's how I stumbled upon AdminOnlyLinks control.  However, I misunderstood its intent either.  I thought it was intended to hide all of the admin links, but its soul purpose was to hide controls which were not already included in pageEditContent.  I thought moving everything into this custom control, including pageEditContent would work.  However, layout.master requires pageEditContent to be present.  I was completely stuck at this point.

3.  Then I discovered that each of the links in the pageEditContent had a separate control assigned to it (except a dropdown), so I added those to my custom control and set the pageEditContent's visibility in layout.master to false.  However, this had a shortcoming of hiding the workflow dropdown menu.

4.  Finally, you clarified everything by using a combination of things.  Since I had special styling applied to my <div id="admin"></div> and I wanted the entire thing hidden, I had to include the entire thing into an AutoHide panel, so that it would hide the "admin" div when there were no asp controls present inside.  pageEditContent place holder hides the links included in it by default along witht he dropdown and the AdminOnlyLinks hides all other links that I decided to add.  AutoHide panel, in turn, hides the remaining HTML since no asp controls are present inside of it once the user logs out.


Hope this  summary of my adventure will help you organize your future tutorial. :)

 

Thanks again for your dedicated support, guys!

 

Best,
Alex
 

You must sign in to post in the forums. This thread is closed to new posts.