How to wrap menu items in SharePoint 2013 global navigation?

This is a quick post to show the code snippet I used to wrap the global navigation items in SharePoint 2013. You can also use custom CSS code in order to get some space between navigation lines and items. First, open default masterpage of your site collection and find the following:

<SharePoint:AspMenu
   ID="TopNavigationMenu"
   Runat="server"
   EnableViewState="false"
   DataSourceID="topSiteMap"
   AccessKey="<%$Resources:wss,navigation_accesskey%>"
   UseSimpleRendering="true"
   UseSeparateCss="false"
   Orientation="Horizontal"
   StaticDisplayLevels="2"
   AdjustForShowStartingNode="true"
   MaximumDynamicDisplayLevels="2"
   SkipLinkText="" />

and replace with the code below:

<SharePoint:AspMenu
   ID="TopNavigationMenu"
   Runat="server"
   EnableViewState="false"
   DataSourceID="topSiteMap"
   AccessKey="<%$Resources:wss,navigation_accesskey%>"
   UseSimpleRendering="false"
   UseSeparateCss="false"
   Orientation="Horizontal"
   StaticDisplayLevels="2"
   AdjustForShowStartingNode="true"
   MaximumDynamicDisplayLevels="2"
   SkipLinkText=""
   ItemWrap="true"
   RenderingMode="List" 
   cssClass="mycss"/>

As you can see, the only diference is:

ItemWrap="true"
RenderingMode="List"
cssClass="mycss"

Create custom CSS file with the following content:

.mycss .level1
{
margin-left: 10px;
margin-right: 20px;
}
.mycss .level2
{
margin-left: 10px;
margin-right: 20px;
}
.mycss .level3
{
margin-left: 10px;
margin-right: 20px;
}

You need a more recent version of SharePoint Designer in SPD 2013?

If you try to open sharepoint site in SharePoint designer you may get following error: “Server error: The version of Microsoft SharePoint Foundation running on the server is more recent than the version of SharePoint Designer that you are using. You need a more recent version of SharePoint Designer.”

 

Solution: In SPD go to Account > Switch Account and type in the credentials of the site you are trying to open (it defaults to your Microsoft Login)

How to manage RSS options on SharePoint site?

In a few SharePoint implementations, clients asked about managing RSS? RSS settings for each site are available under Site Settings – RSS, with options to enable or disable RSS for site collection or site and copyrights parameters. All you have to do is to select or deselect those check boxes.

WFC connection problem in SPD2013

In Microsoft SharePoint Designer 2013, an external content type against a WCF service could show the following error:

Unknown Error occurred. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Reason? This issue occurs because the DLL version that’s returned form the server doesn’t match the one in SharePoint Designer 2013.

Solution? Replace the content of C:\Program Files (x86)\Microsoft Office\Office15\spdesign.exe config file with the following code:

<?xml version="1.0" ?>
<configuration>
 <startup>
  <requiredRuntime version="v2.0.50727" />
  <supportedRuntime version="v2.0.50727" />
 </startup>
<runtime>
 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
   <assemblyIdentity name="Microsoft.BusinessData" publicKeyToken="71e9bce111e9429c" culture="neutral" />
   <bindingRedirect oldVersion="16.0.0.0-65535.65535.65535.65535" newVersion="15.0.0.0"/>
  </dependentAssembly>
 </assemblyBinding>
</runtime>
</configuration>

Remove Sign In link from SharePoint 2013 welcome page

I recently made some customization for SharePoint 2013 website. One of the requirement was to remove default Sign In link from the top of the master page. There is no options in Site Settings for such a thing, and the only was is to use CSS code or to the something easier:

Find and delete the following peace of code:

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

Get year of created date in a calculated column

If you need to extract year from created value, just create new column  and use the following formula:

 

=DATE(YEAR([Created]),1,1)

 

New column should be single text in order to use its value in views and filters, because date format is not supported.

How to change Sharepoint 2013 theme on MySite?

If your “Change the look” link is missing in Site settings, you cannot change theme easily. However, all SP sites have the same URL paths for many options, and you can simply type direct URL for themes.

All you have to do is to simply add “/_layouts/15/designgallery.aspx” to the URL address. Example: http://mysite/_layouts/15/designgallery.aspx. Now you can apply custom theme to MySite

Keep in mind that MySite uses special master page (mysite15.master). It is important to update new composed look with this master page URL.

Enjoy Sharepointing!

 

SharePoint branding with custom CSS?

The custom CSS filelets you apply custom CSS to a SP content. Be aware that option is available only within a SharePoint server publishing site. The custom CSS option also ensures that this CSS file will load last, which prevents the Corev4.css from overriding it.

Here are some useful css tricks:

<style type="text/css">
/* Change ribbon background color */
body #s4-Ribbonrow {
    background-color:#283A10;
} 
</style>
<style type="text/css">
/* Change header */
.s4-title {
height:125px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#C3D6AA',     endColorstr='#283A10'); /* for IE */
background: -moz-linear-gradient(top, #C3D6AA, #283A10); /* for firefox 3.6+ */
}
</style>
<style type="text/css">
/* Change the breadcrumb in the title area */
.s4-title h1 a {
color:#1E4620;
font-variant:small-caps;
font-weight:bold;
}</style>
<style type="text/css">
/* Change the color of the page title in the header area */
.s4-title h2 a {
color:#383838;
}
/* Team Site*/
.ms-WikiPageNameEditor-Display {
color:#383838;
}
/*Blog Site*/   
.s4-titletext h2 {
color:#383838;
}
</style>

How to remove blank space around the web part in SharePoint 2013

Extra space is added to SP webpart by default. It is very unuseful when you organize page content. To remove the extra space injected to the webpart, add the below css in Content Editor webapart on your page.
<style type="text/css">
     .ms-webpartPage-root {
         border-spacing: 0px !important;
     }
       .ms-webpartzone-cell {
         margin: 0px !important;
     }
 </style>

Cannot display the webpage while creating a Web Application in SharePoint

I recently ran into an issue when creating a new web application on SharePoint 2013.  Everything looks fine until the dialog box displayed “Internet Explorer cannot display the webpage”.  I did a little research and found what was the problem. To resolve the issue do the following:

 

  1. Open IIS manager.
  2. In the tree view, open the server name and click on Application Pools.
  3. Locate the SharePoint Central Administration v4 application pool. Right click on it and choose Advanced Settings.
  4. In the Process Model section, set the Shutdown Time Limit to a greater value. As an example, 500.
  5. Restart IIS.