0

OOTB, I see the code for my sign-in link in my .htm master template...

 <!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" AuthenticationRestrictions="AnonymousUsersOnly">-->
 <!--SPM:<wssucw:Welcome runat="server" EnableViewState="false"/>-->
 <!--ME:</SharePoint:SPSecurityTrimmedControl>-->

Is it possible for me to cut it out of the .htm master template and place this code in my .htm page layout instead? If so, what must I do to process this step successfully.

Thanks for any advice

1

I've not seen a snippet for the sign-in control, but I'm not sure you need one here. What I've done in the past is just use some CSS to hide the MS sign-in link and then just added my own as html on the master.html.

A.ms-signInLink { display:none; }

<a href="/_layouts/authenticate.aspx" onclick="document.location='/_layouts/authenticate.aspx?Source='+document.location.href; return false;">Sign in</a>
  • Nice! I'll try that out Monday and confirm. – klewis Jun 29 '14 at 1:24
  • Would there be an alternative to simply put the control into the page layout. I tried doing so, but whenever I upload it tells me "Unknown server tag 'wssucw:Welcome'." – klewis Jul 2 '14 at 12:54
0

I was able to solve this solution with JavaScript. With the help of jQuery, I can preserve the original web control actions and simply move the link to where I would like to to live within the DOM, by using the following in my javascript source file...

//move this OOTB sign in link to another location on my page
$(".ms-signInLink").appendTo(".my-new-location").attr('id', 'my-signin').text('Sign In to Learn More');

Now everything that SharePoint calculated before the DOM loaded, is still preserved (i.e. if you turn on friendly url's or not), plus adding an ID to the element helps me to then brand it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.