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/9/2010 10:23:07 AM
Gravatar
Total Posts 2262

Re: How to enable the signin link for user

Hi,

I have created a download on my Website for this control. You can browse to http://i7media.net/downloads, click mojoPortal and then you will see the AdminOnlyLinks.zip download.

HTH,
Joe D.

4/9/2010 11:14:30 AM
Gravatar
Total Posts 156

Re: How to enable the signin link for user

Thank you so much guys, this helps.  Joe, I like your suggestion for making it invisible and including the admin controls directly.  There's only one thin missing - the workflow dropdown.  What's the control for that?

4/14/2010 11:59:47 AM
Gravatar
Total Posts 156

Re: How to enable the signin link for user

knock knock, anybody there?  I'd really appreciate if you guys could just supply me with a control for the workflow dropdown.

4/14/2010 1:14:20 PM
Gravatar
Total Posts 2262

Re: How to enable the signin link for user

Hi,

Sorry I missed your reply. The control that will generate the drop-down is:

<asp:ContentPlaceHolder ID="pageEditContent" runat="server"></asp:ContentPlaceHolder>

Thanks,
Joe D.

4/15/2010 1:47:40 PM
Gravatar
Total Posts 156

Re: How to enable the signin link for user

Ok, but that's going to display the rest of the controls in it as well and that's exactly what I DO NOT need because I have those admin links in my own customized admin panel.   That's why recommended that I set PageEditContent visibility to false and included the individual controls for each admin link into my custom admin panel.

4/15/2010 2:30:41 PM
Gravatar
Total Posts 2262

Re: How to enable the signin link for user

Hi,

No that control will not display the other items. When the Admin Toolbar was added to mojoPortal, this control was changed to only show the workflow dropdown if the admin links were already on the page.

If the control is displaying the admin links, it probably due to the IDs for those controls being different than what mojoPortal is expecting.

The original intent of the user control I posted on this thread wasn't to hide the admin links from people who aren't admins. It was to hide other links like SiteMap, Search and user defined links from non-admins. While the solution only hides the links and doesn't secure pages, it is what the original poster wanted.

Are you including any of the controls below in your user control?

<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" />

If you do, that will pose an issue. What I have done on other sites when I want to include links to other admin pages like "Content Manager" and "Add/Edit Pages" is put links to those pages inside of my user control and then add my user control to my layout.master in the location that the rest of my admin links appear. So if my links were in a simple list, it would look something like this:

<ul>
  <cc1:AdminOnlyLinks id="AdminOnlyLinks1" runat="server" />
  <li><portal:AdminMenuLink id="lnkAdminMenu" runat="server" /></li>
  <li><portal:FileManagerLink id="lnkFileManager" runat="server" /></li>
  <li><portal:NewPageLink id="lnkNewPage" runat="server" /></li>
  <li><portal:PageEditFeaturesLink id="lnkPageContent" runat="server" /></li>
  <li><portal:PageEditSettingsLink id="lnkPageSettings" runat="server" /></li>
  <li><asp:ContentPlaceHolder ID="pageEditContent" runat="server"></asp:ContentPlaceHolder></li>
</ul>

 My User Control would look like this:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AdminOnlyLinks.ascx.cs" ClassName="AdminOnlyLinks.ascx" Inherits="Controls_AdminOnlyLinks" %>
<portal:LogoutLink id="LogoutLink" runat="server" CssClass="logoff" RenderAsListItem="true" />
<portal:SiteMapLink id="SiteMapLink1" runat="server" RenderAsListItem="true" />
<li><a href="/Admin/ContentCatalog.aspx">Content Manager</a></li>
<li><a href="/Admin/PageTree.aspx">Add/Edit Pages</a></li>

When this renders in my browser, it would look like this:

<ul>
  <li><a class="sitelink logoff" href="/Secure/Logoff.aspx">Sign Out</a></li> 
  <li><a class="sitelink" href="/SiteMap.aspx">Sign Out</a></li>
  <li><a href="/Admin/ContentCatalog.aspx">Content Manager</a></li>
  <li><a href="/Admin/PageTree.aspx">Add/Edit Pages</a></li>
  <li><a class="adminmenulink" href="/Admin/AdminMenu.aspx">Administration</a></li>
  <li><a class="filemanlink" href="/Dialog/FileManagerDialog.aspx">File Manager</a></li>
  <li><a class="newpagelink" href="/Admin/PageSettings.aspx?start=0">New Page</a></li>
  <li><a class="pageeditlink" href="/Admin/PageLayout.aspx?pageid=0">Edit This Page</a></li>
  <li><a class="pagesettingslink" href="/Admin/PageSettings.aspx?pageid=0">Page Settings</a></li>
  <li><select class="ddworkflow" name="ctl01$pageEditContent$ctl00">
          <option value="WorkInProgress" selected="selected">Work in Progress</option>
          <option value="Live">Live Content</option>
        </select>
  </li>
</ul>

 

HTH,
Joe D.

4/15/2010 3:04:39 PM
Gravatar
Total Posts 18409

Re: How to enable the signin link for user

Hi Joe,

The problem is it will not see those controls inside a usercontrol, it will only see them if they are in the master page and if it does not see them it will load them in the content placeholder. The workflow dropdown will be loaded into the <asp:ContentPlaceHolder ID="pageEditContent" runat="server"></asp:ContentPlaceHolder> and this must be in layout.master.

So really there is currently no way for him to have the workflow control inside his usercontrol and given how the workflow system works I think it would be difficult to make it possible to have it inside a usercontrol. 

So currently the pageEditContent must be visible in order to use the workflow, but if it is visible it will also load the admin links.

The best I can do is add a web.config setting to make it not load the admin links in pageEditContent, but it must load the workflow dropdown there, I cannot change that easily.

I really still don't understand why it is needed to wrap these links inside a usercontrol, they only appear to users signed in in the correct roles as they are, so no extra wrapper control is needed to hide them.

Best,

Joe

4/15/2010 3:25:37 PM
Gravatar
Total Posts 2262

Re: How to enable the signin link for user

Hi Joe,

I think you may have misread my last post. I mentioned the id's of the admin link controls. Further, in my example the admin control links aren't inside of the user control.

I think we are thinking the same thing because I also mentioned that the original user control I wrote was specifically for hiding links from non-admins that aren't already hidden.

What alkos333 is trying to do is put all of his links including the admin control links inside of his user control which we have establish will not work. What he needs to do is put his special links that he wants hidden in his user control and all others including the pageEditContent ContentPlaceHolder directly inside the layout.master.

Thanks,
Joe D.

4/15/2010 3:45:43 PM
Gravatar
Total Posts 18409

Re: How to enable the signin link for user

Sorry, I thought he was still wanting to put them inside the usercontrol.

Best,

Joe

4/15/2010 4:31:07 PM
Gravatar
Total Posts 156

Re: How to enable the signin link for user

The reason I want all of my controls in the user  control is because they are wrapped in the admin div which is styled, etc and I want the entire div to disappear.  If I have some of the additional links in control and if PageEditLink is in layout.master, this won't be possible.  Is there a different way to accomplish what I'm trying to do right now?

This is what my current user control looks lik: http://pastebin.com/ynjxEAbu

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.

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