none
UserName is missing while redirecting from home page to search result page - sharepoint 2013

    Question

  • I have custom system master page which is being used for system pages like site settings, site contents and result pages which usually resides under "_layouts/15/" folder. when i go to result page(osssearchresults.aspx) from home page while searching content, master page does not display username and search button which i can see on site contents (viewlsts.aspx) page. 

    here is full custom system master page html, 

    ---- master page starts here---

    <?xml version="1.0" encoding="utf-8"?>
    <!-- _lcid="1033" _version="15.0.4971" _dal="1" -->
    <!-- _LocalBinding -->
    <!DOCTYPE html[]>
    <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
        <head>
            <meta http-equiv="X-UA-Compatible" content="IE=10,Chrome=1" />
            <meta name="ProgId" content="SharePoint.WebPartPage.Document" />
            <meta name="WebPartPageExpansion" content="full" />
            <!--CS: Start Head Snippet-->
            <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
            <!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
            <!--SID:00 -->
            <meta name="GENERATOR" content="Microsoft SharePoint" />
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="X-UA-Compatible" content="IE=10" />
            <meta http-equiv="Expires" content="0" />
            <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
            <meta name="viewport" content="width=device-width" />
            <!--SPM:<SharePoint:RobotsMetaTag runat="server"/>-->
            <!--MS:<SharePoint:PageTitle runat="server">-->
                <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server">-->
                <!--SPM:<SharePoint:ProjectProperty Property="Title" runat="server"/>-->
                <!--SPM:</asp:ContentPlaceHolder>-->
            <!--ME:</SharePoint:PageTitle>-->
            <!--SPM:<SharePoint:StartScript runat="server"/>-->
            <!--MS:<SharePoint:CssLink runat="server" Version="15">-->
                <link rel="shortcut icon" type="image/gif" href="../../PublishingImages/Med.gif" />
            <!--ME:</SharePoint:CssLink>-->
            <!--SPM:<SharePoint:CacheManifestLink runat="server"/>-->
            <!--SPM:<SharePoint:PageRenderMode runat="server" RenderModeType="Standard"/>-->
            <!--SPM:<SharePoint:ScriptLink language="javascript" name="core.js" OnDemand="true" runat="server" Localizable="false"/>-->
            <!--SPM:<SharePoint:ScriptLink language="javascript" name="menu.js" OnDemand="true" runat="server" Localizable="false"/>-->
            <!--SPM:<SharePoint:ScriptLink language="javascript" name="callout.js" OnDemand="true" runat="server" Localizable="false"/>-->
            <!--SPM:<SharePoint:ScriptLink language="javascript" name="sharing.js" OnDemand="true" runat="server" Localizable="false"/>-->
            <!--SPM:<SharePoint:ScriptLink language="javascript" name="suitelinks.js" OnDemand="true" runat="server" Localizable="false"/>-->
            <!--SPM:<SharePoint:CustomJSUrl runat="server"/>-->
            <!--MS:<SharePoint:SoapDiscoveryLink runat="server">-->
            <!--ME:</SharePoint:SoapDiscoveryLink>-->
            <!--MS:<SharePoint:AjaxDelta id="DeltaPlaceHolderAdditionalPageHead" Container="false" runat="server">-->
                <!--MS:<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">-->
                <!--ME:</asp:ContentPlaceHolder>-->
                <!--MS:<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true">-->
                <!--ME:</SharePoint:DelegateControl>-->
                       <!--ME:</SharePoint:AjaxDelta>-->
            <!--SPM:<SharePoint:CssRegistration Name="Themable/corev15.css" runat="server"/>-->
            <!--SPM:<SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server">-->
            <!--SPM:<WebPartPages:SPWebPartManager runat="server"/>-->
            <!--SPM:</SharePoint:AjaxDelta>-->
            <!--CE: End Head Snippet-->
            <!--[if gte mso 9]><xml>
    <mso:CustomDocumentProperties>

    <mso:ContentType msdt:dt="string">Design File</mso:ContentType>
    <mso:ContentTypeId msdt:dt="string">0x0101000F1C8B9E0EB4BE489F09807B2C53288F0054AD6EF48B9F7B45A142F8173F171BD10003D357F861E29844953D5CAA1D4D8A3A00B9CED6D4A38453478290E414077227A3</mso:ContentTypeId>
    <mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
    <mso:HtmlDesignFromMaster msdt:dt="string">http://dev.sp/_catalogs/masterpage/NewLookSystem.html, http://dev.sp/_catalogs/masterpage/NewLookSystem.html</mso:HtmlDesignFromMaster>

    <mso:HtmlDesignStatusAndPreview msdt:dt="string">http://dev.sp/_catalogs/masterpage/NewLookSystem.html, Conversion successful.</mso:HtmlDesignStatusAndPreview>
    <mso:PublishingPreviewImage msdt:dt="string"></mso:PublishingPreviewImage>
    <mso:HtmlDesignPreviewUrl msdt:dt="string"></mso:HtmlDesignPreviewUrl>
    <mso:MasterPageDescription msdt:dt="string"></mso:MasterPageDescription>
    <mso:UIVersion msdt:dt="string">;#15;#</mso:UIVersion>
    <mso:PublishingHidden msdt:dt="string">0</mso:PublishingHidden>
    <mso:HtmlDesignConversionSucceeded msdt:dt="string">True</mso:HtmlDesignConversionSucceeded>
    </mso:CustomDocumentProperties>
    </xml><![endif]-->
            <!--DC:-->
            <!-- CSS -->
          <link rel="stylesheet" href="/Style%20Library/css/medishareCSSNewLookSystem.css" type="text/css" ms-design-css-conversion="no" />
            <!-- css extra-->
          <link rel="stylesheet" href="/Style%20Library/css/pagelayout.min.css" type="text/css" ms-design-css-conversion="no" />
            <!--<link rel="stylesheet" href="/Style%20Library/css/PageLayouts.css" type="text/css" ms-design-css-conversion="no"/>-->
            <!-- jQuery References -->
            <script src="/Style%20Library/js/jquery-latest.min.js">//<![CDATA[   
            //]]>
            </script>
            <script src="/Style%20Library/js/jquery.SPServices.min.js">//<![CDATA[ 
            //]]>
            </script>
            <script src="/Style%20Library/js/SigninHideOptions.js">//<![CDATA[
            //]]>
            </script>
            <!-- end of jquery-->
            <link id="favicon" href="/PublishingImages/Med_Logo1.gif" rel="shortcut icon" type="text/css" />
        </head>
        <body>
            <!-- hide below this ribbon bar-->
            <div id="ms-designer-ribbon">
                <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                <div id="TurnOnAccessibility" style="display:none" class="s4-notdlg noindex">
                    <a id="linkTurnOnAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();document.getElementById('linkTurnOffAcc').focus();return false;">
                        <!--MS:<SharePoint:EncodedLiteral runat="server" text="&#60;%$Resources:wss,master_turnonaccessibility%&#62;" EncodeMethod="HtmlEncode">-->
                        <!--ME:</SharePoint:EncodedLiteral>-->
                    </a>
                </div>
                <div id="TurnOffAccessibility" style="display:none" class="s4-notdlg noindex">
                    <a id="linkTurnOffAcc" href="#" class="ms-accessible ms-acc-button" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();document.getElementById('linkTurnOnAcc').focus();return false;">
                        <!--MS:<SharePoint:EncodedLiteral runat="server" text="&#60;%$Resources:wss,master_turnoffaccessibility%&#62;" EncodeMethod="HtmlEncode">-->
                        <!--ME:</SharePoint:EncodedLiteral>-->
                    </a>
                </div>
                <!--SID:02 {Ribbon Snippet}-->
                <!--PS: Start Preview--><div class="DefaultContentBlock" style="background:rgb(0, 114, 198); color:white; width:100%; padding:8px; height:64px; ">In true previews of your site, the SharePoint ribbon will be here.</div><!--PE: End Preview-->
            </div>
            <div id="s4-workspace">
                <div id="s4-bodyContainer">
                    <!-- Loader -->
                      <header class="ms-dialogHidden">
                    <div id="hloader" class="hloaderDiv">
                        <table class="master">
                            <tr>
                                <td style="width:89px;">
                                    <a href="/Pages/Home_nobanner.aspx">
                                        <img src="/Style%20Library/Images/m2.gif" class="m2image" />
                                    </a>
                                </td>
                                <!-- new div for text-->
                                <td>
                                    <div id="medicaidfullnameDiv" class="medicaidfullnameDivclass">
                                        <span> Agency
                                        </span>
                                    </div>
                                    <div id="medicaidDiv" class="medicaidDivclass">
                                        <span>MED
                                        </span>
                                    </div>
                                </td>
                                <!-- end of med text-->
                                <td style="float: right; padding-right:22px;">
                                    <table>
                                        <tr style="float: right;">
                                            <td style="padding-bottom:7px">
                                                <div id="ActionContainer" style="color:fuchsia">
                                                </div>
                                                <!--<a class="editUserPhoto" target="_blank" href="http://dev.mysite/_layouts/15/EditProfile.aspx" hrefbefore="https://outlook.office365.com/owa/?path=/options/myaccount/action/photo" title="EDIT">
                                    <img class="userPhoto"/>
                                    <span class="glyphicon glyphicon-pencil editUserPhotoPencil"></span>
                                    </a>-->
                                                <!-- User Name -->
                                                <span class="uName" data-name="SignIn">
                                                    <!--CS: Start Sign In Snippet-->
                                                    <!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                                                    <!--SPM:<%@Register Tagprefix="wssucw" TagName="Welcome" Src="~/_controltemplates/15/Welcome.ascx"%>-->
                                                    <!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" AuthenticationRestrictions="AllUsers" ID="myName">-->
                                                        <!--MS:<wssucw:Welcome runat="server" EnableViewState="false">-->
                                                        <!--ME:</wssucw:Welcome>-->
                                                    <!--ME:</SharePoint:SPSecurityTrimmedControl>-->
                                                    <!--CE: End Sign In Snippet-->
                                                </span>
                                                <!--<span class="ms-siteactions-root" id="siteactiontd">
                                                    <span id="zz11_SiteActionsMenu_t" class="ms-siteactions-normal" title="Settings" onmouseover="MMU_PopMenuIfShowing(this);MMU_EcbTableMouseOverOut(this, true)" hoveractive="ms-siteactions-normal ms-siteactions-hover" hoverinactive="ms-siteactions-normal" onclick=" CoreInvoke('MMU_Open',byid('zz6_SiteActionsMenuMain'), MMU_GetMenuFromClientId('zz11_SiteActionsMenu'),event,true, null, 0); return false;" foa="MMU_GetMenuFromClientId('zz11_SiteActionsMenu')" oncontextmenu="ClkElmt(this); return false;">
                                                        <a class="ms-core-menu-root" id="zz11_SiteActionsMenu" accesskey="/" href="javascript:;" title="Settings" onkeydown="MMU_EcbLinkOnKeyDown(byid('zz6_SiteActionsMenuMain'), MMU_GetMenuFromClientId('zz11_SiteActionsMenu'));" menutokenvalues="MENUCLIENTID=zz11_SiteActionsMenu,TEMPLATECLIENTID=zz6_SiteActionsMenuMain" serverclientid="zz11_SiteActionsMenu">
                                                         <span class="ms-siteactions-imgspan">
                                                                <img class="ms-core-menu-buttonIcon" src="/_layouts/15/images/spcommon.png?rev=23" alt="Settings" title="Settings"/>
                                                            </span>
                                                            <span class="ms-accessible">Use SHIFT+ENTER to open the menu (new window).
                                                          </span>
                                                        </a>
                                                    </span>
                                                </span>-->
                                            </td>
                                        </tr>
                                        <!-- End: User Name -->
                                        <tr>
                                            <td>
                                                <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">-->
                                                <div id="searchInputBox">
                                                    <!--SPM:<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox"/>-->
                                                    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><div class="ms-webpart-chrome "><div WebPartID="00000000-0000-0000-0000-000000000000" HasPers="true" id="WebPart" width="100%" class="ms-WPBody noindex " OnlyForMePart="true" allowDelete="false" style=""><div componentid="ctl00_SmallSearchInputBox1_csr" id="ctl00_SmallSearchInputBox1_csr"><div id="SearchBox" name="Control"><div class="ms-srch-sb ms-srch-sb-border" id="ctl00_SmallSearchInputBox1_csr_sboxdiv"><input type="text" value="Search Medishare..." maxlength="2048" accessKey="S" title="Search Medishare..." id="ctl00_SmallSearchInputBox1_csr_sbox" autocomplete="off" autocorrect="off" class="ms-srch-sb-prompt ms-helperText" /><a title="Search" class="ms-srch-sb-searchLink" id="ctl00_SmallSearchInputBox1_csr_SearchLink" href="javascript: {}"><img src="http://dev.sp/_layouts/15/images/searchresultui.png" class="ms-srch-sb-searchImg" id="searchImg" alt="Search" /></a><div class="ms-qSuggest-container ms-shadow" id="AutoCompContainer"><div id="ctl00_SmallSearchInputBox1_csr_AutoCompList"></div></div></div></div></div><div id="ctl00_SmallSearchInputBox1"></div><div class="ms-clear"></div></div></div><!--PE: End of READ-ONLY PREVIEW-->
                                                </div>
                                                <!--SPM:</asp:ContentPlaceHolder>-->
                                            </td>
                                        </tr>
                                    </table>
                                    <!--end of new site action menu-->
                                </td>
                            </tr>
                        </table>
                    </div>
                    <!-- end of div class hloader-->
                    <!-- Header -->
                    <!--<header class="ms-dialogHidden">-->
                    <div id="header" class="headerDiv">
                        <div id="megamenudiv" class="masterMegamenu">
                            <div class="ms-breadcrumb-top">
                                <div class="ms-breadcrumb-dropdownBox topNavFlyOutsItem" style="display:none;">
                                    <!--SPM:<SharePoint:AjaxDelta id="DeltaBreadcrumbDropdown" runat="server">-->
                                    <!--SPM:<SharePoint:PopoutMenu
            Visible="false"
            runat="server"
            ID="GlobalBreadCrumbNavPopout"
            IconUrl="/_layouts/15/images/spcommon.png?rev=23"
            IconAlt="&#60;%$Resources:wss,master_breadcrumbIconAlt%&#62;"
            ThemeKey="v15breadcrumb"
            IconOffsetX="215"
            IconOffsetY="120"
            IconWidth="16"
            IconHeight="16"
            AnchorCss="ms-breadcrumb-anchor"
            AnchorOpenCss="ms-breadcrumb-anchor-open"
            MenuCss="ms-breadcrumb-menu ms-noList">-->
                                    <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">-->
                                    <!--SPM:<SharePoint:ListSiteMapPath
                    runat="server"
                    SiteMapProviders="SPSiteMapProvider,SPContentMapProvider"
                    RenderCurrentNodeAsLink="false"
                    PathSeparator=""
                    CssClass="ms-breadcrumb"
                    NodeStyle-CssClass="ms-breadcrumbNode"
                    CurrentNodeStyle-CssClass="ms-breadcrumbCurrentNode"
                    RootNodeStyle-CssClass="ms-breadcrumbRootNode"
                    NodeImageOffsetX="0"
                    NodeImageOffsetY="289"
                    NodeImageWidth="16"
                    NodeImageHeight="16"
                    NodeImageUrl="/_layouts/15/images/fgimg.png?rev=23"
                    RTLNodeImageOffsetX="0"
                    RTLNodeImageOffsetY="312"
                    RTLNodeImageWidth="16"
                    RTLNodeImageHeight="16"
                    RTLNodeImageUrl="/_layouts/15/images/fgimg.png?rev=23"
                    HideInteriorRootNodes="true"
                    SkipLinkText=""/>-->
                                    <!--SPM:</asp:ContentPlaceHolder>-->
                                    <!--SPM:</SharePoint:PopoutMenu>-->
                                    <!--SPM:</SharePoint:AjaxDelta>-->
                                </div>
                                <!--SPM:<SharePoint:AjaxDelta id="DeltaTopNavigation" BlockElement="true" CssClass="ms-displayInline" runat="server">-->
                                <!--SPM:<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">-->
                                <!--SPM:<Template_Controls>-->
                                <!--SPM:<asp:SiteMapDataSource 
                    ShowStartingNode="False"
                    SiteMapProvider="SPNavigationProvider" 
                    id="topSiteMap" 
                    runat="server"
                    StartingNodeUrl="sid:1002"/>-->
                                <!--SPM:</Template_Controls>-->
                                <!--SPM:</SharePoint:DelegateControl>-->
                                <a name="startNavigation">
                                </a>
                                <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">-->
                                <!--SPM:<SharePoint:AspMenu 
                ID="TopNavigationMenu" 
                Runat="server" 
                EnableViewState="false"
                DataSourceID="topSiteMap"
                AccessKey="&#60;%$Resources:wss,navigation_accesskey%&#62;"
                UseSimpleRendering="true"
                UseSeparateCss="false"
                Orientation="Horizontal"
                StaticDisplayLevels="2"
                AdjustForShowStartingNode="true"
                MaximumDynamicDisplayLevels="2"
                SkipLinkText=""/>-->
                                <!--PS: Start of READ-ONLY PREVIEW (do not modify)-->
                                <!--<link rel="stylesheet" type="text/css" href="http://dev.sp/Style%20Library/en-US/Core%20Styles/Band.css" />
                                <div id="zz7_TopNavigationMenu" class="noindex ms-core-listMenu-horizontalBox"><ul id="zz9_RootAspMenu" 
                                class="root ms-core-listMenu-root static"><li class="static">
                                <a class="static menu-item ms-core-listMenu-item ms-displayInline ms-navedit-linkNode" 
                                tabindex="0" title="Default Publishing Site" href="#" accesskey="1"><span class="additional-background"><span class="menu-item-text ">Default Publishing Site</span></span></a></li></ul></div>-->
                                <!--PE: End of READ-ONLY PREVIEW-->
                                <!--SPM:</asp:ContentPlaceHolder>-->
                                <!--SPM:</SharePoint:AjaxDelta>-->
                            </div>
                        </div>
                    </div>
                    </header>
                    <!-- End: Header -->
                    
          
                    
                    <!-- Body -->
                 
                       
                   </div>   
                    <!-- End: Body -->
               </div>        
                  <!-- start of footer tag-->
                 <!--<div class="footer">
      <p>test</p>
    </div>-->              
                  <!-- end of footer tag-->
                <!-- End: s4-bodyContainer -->
                </div>
                <!-- End: s4-workspace -->
            </div>
            
        </body>
    </html>



    ------ end of master page here-------------------------------------------------

    I am using following js script to pop up user name and trim site action menu item based on permission,

    -- ------------js script start here---

    ExecuteOrDelayUntilScriptLoaded(CustomFun, "sp.js");         function CustomFun() {             var web, clientContext, currentUser, oList, perMask;             clientContext = new SP.ClientContext.get_current();             web = clientContext.get_web();             currentUser = web.get_currentUser();             clientContext.load(currentUser);             clientContext.load(web);                          clientContext.executeQueryAsync(function () {                 var loginName = currentUser.get_title();                 if ($('.ms-siteactions-imgspan').length > 0) {                     $('.ms-siteactions-imgspan').text(loginName);                     $('#suiteBarButtons').find('span[title="Settings"]').appendTo($('#ActionContainer')); $('#welcomeMenuBox').css('display','none !important')                 }                 else {                     $('#welcomeMenuBox').appendTo($('#ActionContainer'));                                                        }                 var isAdmin = currentUser.get_isSiteAdmin();                 if (!isAdmin) {                 // $('.ms-core-menu-separator').hide();                                                                             $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Show Ribbon\"]{"+ "display:none !important;"+ "}").appendTo("head");                                                  $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Shared with...\"]{" + "display:none !important;" + "}").appendTo("head");                                                          $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Edit page\"]{" + "display:none !important;" + "}").appendTo("head");                                          $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Add a Page\"]{" + "display:none !important;" + "}").appendTo("head");                     $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Add an app\"]{" + "display:none !important;" + "}").appendTo("head");                     $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Site contents\"]{" + "display:none !important;" + "}").appendTo("head");                     $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Design Manager\"]{" + "display:none !important;" + "}").appendTo("head");                     $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Site settings\"]{" + "display:none !important;" + "}").appendTo("head");                               }            else{                         $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Show Ribbon\"]{"+ "display:none !important;"+ "}").appendTo("head");              $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Shared with...\"]{" + "display:none !important;" + "}").appendTo("head");                 $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Design Manager\"]{" + "display:none !important;" + "}").appendTo("head");                          }             }, function (sender, args) {                 alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());             });         }

    --------------end of js script here----- --------------

    error is that i can not see my username and search button while going to search result page and site setting page whereas i can see my username and search button on site content page as seen below,


    any help?

    thanks

    DK

    Wednesday, November 7, 2018 8:36 PM

All replies

  • Hi,

    Can you apply the custom master page for osssearchresults.aspx?

    By default, if you set custom master page as site default master page, it will not apply to the osssearchresults.aspx page or settings.aspx page.

    You can using IE F12 developer tool to check the source code of the osssearchresults.aspx in browser, check if your custom code exists in this page.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Thursday, November 8, 2018 8:51 AM
    Moderator
  • i have set above given master page as system master page for those pages so it should work for result page as it works for site content page.  i checked and custom code exists in osssearchresults.aspx page.

    Thanks

    Thursday, November 8, 2018 2:14 PM
  • Hi,

    The "/15/viewlsts.aspx" page and "/15/osssearchresults.aspx" are not use the same master page.

    The viewlsts.aspx using the default site master page, so it works.

    Can you find the below HTML code in osssearchresults.aspx page in the browser source code?

     <div id="ActionContainer" style="color:fuchsia"></div>

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Friday, November 9, 2018 7:34 AM
    Moderator
  • i found following code for osssearchresults.aspx  page in the browser source code,

    and

    I found following code for viewlsts.aspx in browser source code where you can see span id=zz10_siteactionmenu_t

    let me know what should be done here?

    Thanks

    Friday, November 9, 2018 2:56 PM
  • Hi,

    Try to add the JavaScript code into the osssearchresults.aspx page and in the code to check if the current url include viewlsts.aspx.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Monday, November 12, 2018 10:00 AM
    Moderator
  • HI dennis,

    how can i add js code to osssearchresults.aspx page. can you show me way to add with example?

    Thanks

    Tuesday, November 13, 2018 5:18 PM
  • Hi,

    Add the JS code into "PlaceHolderMain" in osssearchresults.aspx.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Thursday, November 15, 2018 8:10 AM
    Moderator
  • HI Dennis,

    it works with your code alert. but when i placed my code inside page, it does not work. see here code inside osssearchresults.aspx page. 

    let me know what need to be correct here.

    ---------code start here----------

                                                                                

    <%@ Assembly Name="Microsoft.Office.Server.Search, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> <%@ Page Language="C#" DynamicMasterPageFile="~masterurl/default.master" Inherits="Microsoft.Office.Server.Search.Internal.UI.OssSearchResults"   EnableViewState="false"    %> <%@ Import Namespace="Microsoft.Office.Server.Search.Internal.UI" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
    <%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="SearchWC" Namespace="Microsoft.Office.Server.Search.WebControls" Assembly="Microsoft.Office.Server.Search, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

    <asp:Content ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"  runat="server">
        <SharePoint:EncodedLiteral runat="server" text="<%$Resources:Microsoft.Office.Server.Search, Search_SitePage_Title%>" EncodeMethod="HtmlEncode"/>
    </asp:Content>

    <asp:Content ContentPlaceHolderId="PlaceHolderSearchArea" runat="server"> 
    </asp:Content>

    <asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"> 
        <SearchWC:RefinementScriptWebPart runat="server" ChromeType="None"/>
        &nbsp;
    </asp:Content>

    <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> 

    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(CustomFun, "sp.js");
            function CustomFun() {
                var web, clientContext, currentUser, oList, perMask;
                clientContext = new SP.ClientContext.get_current();
                web = clientContext.get_web();
                currentUser = web.get_currentUser();
                clientContext.load(currentUser);
                clientContext.load(web);

                clientContext.executeQueryAsync(function () {
                    var loginName = currentUser.get_title();
                    if ($('.ms-siteactions-imgspan').length > 0) {
                        $('.ms-siteactions-imgspan').text(loginName);
                        $('#suiteBarButtons').find('span[title="Settings"]').appendTo($('#ActionContainer'));
    $('#welcomeMenuBox').css('display','none !important')

                    }
                    else {
                        $('#welcomeMenuBox').appendTo($('#ActionContainer'));

                    }
                    var isAdmin = currentUser.get_isSiteAdmin();
                    if (!isAdmin) {
                    // $('.ms-core-menu-separator').hide();

    $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Show Ribbon\"]{"+ "display:none !important;"+ "}").appendTo("head");                             
                        $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Shared with...\"]{" + "display:none !important;" + "}").appendTo("head");                                     
                        $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Edit page\"]{" + "display:none !important;" + "}").appendTo("head");                     
                        $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Add a Page\"]{" + "display:none !important;" + "}").appendTo("head");
                        $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Add an app\"]{" + "display:none !important;" + "}").appendTo("head");
                        $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Site contents\"]{" + "display:none !important;" + "}").appendTo("head");
                        $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Design Manager\"]{" + "display:none !important;" + "}").appendTo("head");
                        $("<style>").prop("type", "text/css").html(".ms-core-menu-list>li[text=\"Site settings\"]{" + "display:none !important;" + "}").appendTo("head");

               }
                }, function (sender, args) {
                    alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
                });
            }
    </script>
        <div class='ms-srch-siteSearchResults'>
            <SearchWC:SearchBoxScriptWebPart PageTitlePrefix="<%$Resources:Microsoft.Office.Server.Search, Search_Results_Page_Title%>" RenderTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/Search/Control_SearchBox.js" EmitStyleReference="false" ShowNavigation="true" ChromeType="None" runat="server"/> <SearchWC:ResultScriptWebPart runat="server" ChromeType="None" UseSharedDataProvider="true" ShowAdvancedLink="false" ScrollToTopOnRedraw="true" ShowUpScopeMessage="true"/> <SearchWC:DataProviderScriptWebPart runat="server" ChromeType="None" IgnoreStaleServerQuery="true" ClientType="SiteResultsQuery-All" QueryPropertiesTemplateUrl="sitesearch://webroot" />
        </div>
    </asp:Content>

    ----------------------end of code here-------------

    Thanks

    Dk

    Thursday, November 15, 2018 2:54 PM