Monday, February 13, 2012

Relative Links

If you have stored your CSS and JavaScript within the physical file directory situated in the 14 hive folder, or in a static place as in the Style Library in the root, you will need to modify the above example to the following:
<!-- CSS -->
<SharePoint:CSSRegistration Name="<% $SPUrl:~SiteCollection/Style Library/CSS/Style.css%>" runat="server"/>

<!-- JavaScript -->
<SharePoint:ScriptLink ID="ScriptLink1" Name="<% $SPUrl:~SiteCollection/Style Library/Script/Script.js%>" runat="server"/>
This code is useful using content deployment for example.

Hide the Ribbon in Anonymous Mode

Go to your master page and find the "s4-ribbonrow" div:
<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle">
Add inline style "display:none" to it:
<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle" style="display:none">
Insert the following code AFTER the s4-ribbonrow div closes:
<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddAndCustomizePages">
    <script type="text/javascript">
        document.getElementById("s4-ribbonrow").style.display = "block";
   
</script>
</
Sharepoint:SPSecurityTrimmedControl>
Read more at:

Customizing SharePoint 2010 Social Tags: I Like It | Tags & Notes

The social tags in the Master Page can be changed from:
<SharePoint:DelegateControl ControlId=”GlobalSiteLink3″ Scope=”Farm” runat=”server”/>
To the “mini” mode:

<SharePoint:DelegateControl ControlId=”GlobalSiteLink3-mini” Scope=”Farm” runat=”server”/>
Read more at:

Sunday, February 12, 2012

Centered layout with CSS & v4.master

When customizing SharePoint 2010 Master Page with a static width, you often want to center the content of the page.
Here is the CSS for centering the contents in the ribbon container and letting the container it behave as designed:
#s4-ribbonrow > #s4-ribboncont > #RibbonContainer > #Ribbon > .ms-cui-ribbonTopBars > div {
width: 990px;
margin: 0 auto;
float: none;
}

#s4-ribbonrow > #s4-ribboncont > #RibbonContainer > #Ribbon > .ms-cui-ribbonTopBars > div,
#s4-bodyContainer > div,
body #s4-titlerow > div
{
width: 990px;
margin: 0 auto;
float: none;
}

read more at:

How to insert HTML tags into Workflow E-mail template?

Click on the Field in the Workflow – “Email these users” -> “Advanced Properties” -> "...".
Here you can build the HTML in the string builder, but DO NOT ERASE THE "<!DOCTYPE.........​ format -->
If you try to insert a big size in an image tag you will get and you get one pixel strip of the picture - the picture is too big, try to resize it.

User Cannot Create Pages Based on Page Layout

When a user cannot create pages from a customized page layout, and the user has “Contribute” permissions, Grant the user permissions to the “Master Pages and Page Layouts” (“Restricted Read” permissions level is enough for that). This library has unique permissions and it not inherits from the sites permissions.

Collapse/Expand Is Not Working

When we have a list with a group by a choice field view, and we changed the values we might cause a little problem. After changing the values in that field, the view will show us the values in the headers, but when clicking on them it will display: “Loading…” for two seconds and will disappear without showing any items below.
The problem is when changing the values in that field, we need to change the values in the items as well.
The script searches in the list/library the exact value. If it has been changed from “1234” to “12345” it will not be a problem. But if it has been changed from “1234” to “1245”, or “12 34” or “12-34” or any other change within the value and not before or after it will cause a problem.