SharePoint Search on default Masterpage - sharepoint

I am trying to enable the search bar on my default master page. In the source code of the master page there is the following:
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox"/>
</asp:ContentPlaceHolder>
In the render of the page in design mode it says [DelegateControl]. When I publish the page, I do not see a search box, I see nothing... can someone point me in the direction as how to enable search on my default master page, thanks.

I had the exact same problem but eventually found a very simple solution. You just need to make sure your asp:ContentPlaceHolder is within an html form. I don't know exactly why this is the case, but simply changing your code to
<form id="Form1" runat="server">
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox"/>
</asp:ContentPlaceHolder>
</form>
should solve the problem.
I found this very simple application.master page: http://blogs.microsoft.co.il/blogs/justguy/archive/2008/08/31/empty-application-master.aspx
When the search boxes worked using this simple master page, I was able to track down the problem and find the needed element.

Are you certain that you MOSS Search service is correctly configured?
If not, check this article:
http://www.mysharepointblog.com/post/2008/10/Configure-Search-On-MOSS-2007-(Microsoft-Office-SharePoint-Server).aspx

Have you activated the "Office SharePoint Server Standard Site Collection features" from the site features?

Related

Change the subsite Logo URL IN SharePoint

I have created a main site and I have created many subsite under the main site.
When I am in any main page and click on the logo icon, the page redirects to the home page.
But, when I am in any subsite and click on the logo icon, the page redirects to the subsite homepage rather than the main hompage.
I would like to change the navigation URL to the root site. Let me know if I have to edit any masterpage, or is there any common page that will inherit to all the child application.
Thanks
We have 2 ways to do this.
Method 1:
From the Snippet Gallery, copy and paste the default SiteLogo code snippet into your master page into the appropriate place you want it to be displayed.
In the SiteLogo code, search for SharePoint:SPSimpleSiteLink to find the relevant opening and closing tags. Now simply change the tag names to SharePoint:SPLinkButton instead.
Then simply add the attribute NavigateUrl to this tag and set it’s value to “~sitecollection/”.
Example:
Default snippet code:
<!--MS:<SharePoint:SPSimpleSiteLink runat="server" CssClass="ms-siteicon-a" ID="x7917ecc8c38d4bd69f58e338eab54c8c">-->
...
<!--ME:</SharePoint:SPSimpleSiteLink>-->
Should become this:
<!--MS:<SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/" CssClass="ms-siteicon-a" ID="x7917ecc8c38d4bd69f58e338eab54c8c">-->
...
<!--ME:</SharePoint:SPLinkButton>-->
Ref link
Method 2:
We are going to add custom js in the master page => our site is a publishing site
We find the site logo in the below hierarchy(in a rendered page).
<div id='DeltaSiteLogo'>
<a href='site url'>
<img src='siteIconPath.png/whatever extension'/>
</a>
</div>
So we may try the following for redirecting to the site collection/root web url on click of the logo.
// Add the following js in the '.html' design file that associates with the corresponding masterpage.
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
$("div#DeltaSiteLogo a").attr("href",_spPageContextInfo.siteAbsoluteUrl);
});
//]]>
</script>
It works.
Edit on the SharePoint Designer Master Pages > seattle.master .
Crtl F - Search for DeltaSiteLogo
DEFAULT:
<SharePoint:SPSimpleSiteLink CssClass="ms-siteicon-a" runat="server" id="onetidProjectPropertyTitleGraphic" >
<SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=47" runat="server"/>
</SharePoint:SPSimpleSiteLink>
Change To This (copy & paste the script):
<SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/" CssClass="ms-siteicon-a" ID="x7917ecc8c38d4bd69f58e338eab54c8c">
<SharePoint:SiteLogoImage CssClass="ms-siteicon-img" name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/_layouts/15/images/siteIcon.png?rev=47" runat="server"/>
</SharePoint:SPLinkButton>

Sharepoint master page asp:repeater tag

I am currently working on generating a master page for a sharepoint instance. It is however giving some issues when attempting to convert over an ASP repeater
The following works in generating a repeated text:
<!--MS:<asp:Repeater ID="TopMenu" runat="server" DataSourceID="selectedSiteMap">-->
<!--MS:<HeaderTemplate> -->
<!--ME:</HeaderTemplate> -->
<!--MS:<ItemTemplate> -->
<li>test</li>
<!--ME:</ItemTemplate> -->
<!--MS:<FooterTemplate> -->
<!--ME:</FooterTemplate> -->
<!--ME:</asp:Repeater> -->
<!--MS:<asp:SiteMapDataSource SiteMapProvider="CurrentNavigation" ShowStartingNode="false"
StartFromCurrentNode="false" StartingNodeOffset="0" StartingNodeUrl="sid:1002"
EnableViewState="true" ID="selectedSiteMap" runat="server" /> -->
However the following does not work:
<!--MS:<asp:Repeater ID="TopMenu" runat="server" DataSourceID="selectedSiteMap">-->
<!--MS:<HeaderTemplate> -->
<ul id="main_menu_ul" class="">
<!--ME:</HeaderTemplate> -->
<!--MS:<ItemTemplate> -->
<li><a href=<!--MS:"<%# Eval("Url")%>"--> class="link">
<!--MS:<%# Eval("Title")%>--></a></li>
<!--ME:</ItemTemplate> -->
<!--MS:<FooterTemplate> -->
</ul>
<!--ME:</FooterTemplate> -->
<!--ME:</asp:Repeater> -->
<!--MS:<asp:SiteMapDataSource SiteMapProvider="CurrentNavigation" ShowStartingNode="false"
StartFromCurrentNode="false" StartingNodeOffset="0" StartingNodeUrl="sid:1002"
EnableViewState="true" ID="selectedSiteMap" runat="server" /> -->
So far I have identified the issue is 2 fold:
1. the converter is does not like the fact that the opening ul and closing ul dont exactly match
2. the converter does not like the eval tags at all.
Any help anyone could give to getting this repeater to work properly would be very helpful. Thank you
The other possibility is that you are manually uploading your master page (as opposed to deploying it using a feature). The <%# Eval("Url")%> tag is seen as server-side code, and it turns out that there is a security limitation that server-side code is not allowed in customized pages - in other words, ones that are unghosted.
So if you customize a master page using SharePoint designer, the new copy exists in the content database, and this is regarded as customized.
I hit this recently - deployed an aspx master page (with a repeater control in it) using a feature, download a copy, re-upload it (with no changes) and bang - error. Code blocks not allowed in this file.
As you're putting this in an html master page, you're probably just masking the real reason for the error. You could try adding an entry to the web.config (see, for example, this blog) to specify that your master page can have code blocks.
It might because You have opened
MS: before you Eval("") but there is no closing ME: after eval tag.

Multiple Rich Text Edit Fields in Edit View

I have a Sharepoint site with a Master Page that has a main content area and a sidebar content area.
In one of my pages I have the need to allow the user to edit the content of the main content area and the sidebar content area from the Edit mode.
Currently, in the HTML of one of my pages, in main content area of a page (inside <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">) i have the follow code snippet which appears to allow a HTML edit box in Edit mode.
<SharePoint:EmbeddedFormField id="wikiField" FieldName="wikiField" ControlMode="Display" runat="server" />
I have tried to replicate this inside the <asp:Content ContentPlaceHolderId="PlaceHolderSidebar" runat="server"> tag, but this simply displays the content of my main body content and does not give me the option to edit this.
When a user enters Edit mode, I need to display two rich text HTML editors, one for the main content and one for the sidebar. What HTML tags will allow me to achieve this?
I do not have access to SharePoint Designer 2013 and cannot install it for reasons I will not go into.
Thanks
Try using this:
<PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" HasInitialFocus="True" MinimumEditHeight="400px" runat="server"/>
And add a reference to this if it's not already at the top of your master.
<%# Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
You may need to activate the publishing feature for this - I can't remember if it works without it or not.

Sharepoint calendar web part not working in Chrome Browser

I have a calendar web part in my SharePoint site which works fine in Firefox and IE but does not work in chrome browser.
This is the same situation i am facing.
http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010programming.aspx?ID=9dde800d-7ce0-4069-93d7-2adf2c53d94b
Any suggestions ?
One more thing to add here is that , I have a content Query web part which will rotate the Promotions using JQuery cycle plug in. It is on the same page where I have put the list and library web part with calendar Month view as a default view.
If I remove that CQWP with Promotions everything works fine but if it there it wont work
Any suggestions? I have checked for the Jquery conflicts but could not find any of them .
Thanks
I think that I have find the root cause of my problem
There is one CQWP placed on the same page with this Calendar view list.
This CQWP ha call to jquery cycle plugin which will cycle the content after some interval , due to this JQuery conflicts my calendar control is not working in chrome.
Whem I Remove this CQWP everything works like a charm!!!
1st, try to revert back to the OOB v4.master to see if the problem disappears. If it works as expected, this mean that your masterpage have some issue.
One of the most ridiculous bug in SP is that if you don't have the SiteAction control declared before the ribbon control, some javascript codes will fails.
In one of my custom master page, I have to create a second siteactions control, just before the ribbon control. I've put it into a invisible DIV to completely hide it from the user.
It ends with something like this :
<SharePoint:SPRibbon ID="SPRibbon1" runat="server" PlaceholderElementId="RibbonContainer"
CssFile="">
<SharePoint:SPRibbonPeripheralContent ID="SPRibbonPeripheralContent1" runat="server"
Location="TabRowLeft" CssClass="ms-siteactionscontainer s4-notdlg">
<!-- Here is the hidden site actions control -->
<div style="display: none">
<SharePoint:SiteActions runat="server" AccessKey="<%$Resources:wss,tb_SiteActions_AK%>"
ID="SiteActionsMenuMain" PrefixHtml="" SuffixHtml="" MenuNotVisibleHtml="&nbsp;">
<CustomTemplate>
</CustomTemplate>
</SharePoint:SiteActions>
</div>
<asp:ContentPlaceHolder ID="PlaceHolderGlobalNavigation" runat="server" Visible="false">
<SharePoint:PopoutMenu
runat="server"
>
.... Removed for readability ....
</SharePoint:PopoutMenu>
<div class="s4-die">
<asp:ContentPlaceHolder ID="PlaceHolderGlobalNavigationSiteMap" runat="server" Visible="false">
</asp:ContentPlaceHolder>
</div>
</asp:ContentPlaceHolder>
</SharePoint:SPRibbonPeripheralContent>
<SharePoint:SPRibbonPeripheralContent runat="server" Location="TabRowRight" ID="RibbonTabRowRight"
CssClass="s4-trc-container s4-notdlg">
.... Removed for readability ....
</SharePoint:SPRibbonPeripheralContent>
</SharePoint:SPRibbon>
For your information, this behavior is due to one the inner control of the site action (PublishingConsole if I'm right). This inner control will produces some javascript global variable declaration (language and one another). This global variables are required by the ribbon control to works as expected.

Relative URLs in Sharepoint master page

I have a master page with tabs. The tabs are defined by the following sitemap file:
<siteMap>
<siteMapNode title="Home" url="~/" >
<siteMapNode title="Schedule" url="~/Pages/Tab2.aspx"/>
<siteMapNode title="Deliverables" url="~/Pages/Tab3.aspx"/>
<siteMapNode title="My Items" url="~/Pages/Tab4.aspx"/>
<siteMapNode title="Management" url="~/Pages/Tab5.aspx"/>
<siteMapNode title="Working Docs" url="~/Pages/Tab6.aspx"/>
</siteMapNode>
</siteMap>
The problem is that on my subsites, clicking on a tab keeps taking me back to the root. For example, I want the schedule link to go to http://Server/Subsite/Pages/Tab2.aspx. Instead, what I am getting is http://Server/Pages/Tab2.aspx. I read that having a tilde at the beginning of the link would solve this problem but it doesn't.
I spent HOURS looking for the answer to this question, and it turns out there IS one, it's just annoying. You can use the ProjectProperty tag in WSS sites AND MOSS sites, and one of the possible parameters for ProjectProperty gives you the subsite's URL.
<SharePoint:ProjectProperty Property="Url" runat="server"/>
That outputs a string literal with the value of the subsite URL. So, for example, you can do this (note that you need to use single-quotes for the src='' or href='' attribute of the actual HTML tag):
<a href='<SharePoint:ProjectProperty Property="Url" runat="server"/>/pages/Tab2.aspx'>
Hope it helps! For a listing of other possible values for ProjectProperty, check out this guy's page (which is where i found my original answer!)
I was looking for an answer to do this for a long time... I want to package my site as a Site Template and having absolute URLs was not an option... I need them to be relative to what ever the site URL is... whether it is at the root of MOSS or a sub-site deep down in the structure...
I found the following to work:
Script Tags:
<script type="text/javascript" src='<asp:Literal runat="server"
Text="<% $SPUrl:~Site/appBin/js/jquery.min.js %>" />'></script>
Style sheet (Method suggested above by user385947):
<link rel="stylesheet" type="text/css"
href="<% $SPUrl:~Site/appBin/css/jquery-ui.css %>" />
Hope this helps others...
You're looking for the ~site token, here's a list of the URL tokens custom to WSS.

Resources