Sharepoint Foundation master pages on subsites - sharepoint

Using Sharepoint Foundation 2010 I've edited v4.master, added a ref to a new CSS file, saved the changes and they are applied to the home site no problem.
However when I create a subsite it uses the old version of v4.master for some irritating reason. I'm vaguely aware that some of the publishing features from SPS are not included in SPF so lots of the online advice isn't relevent (?)
If there is a way to make new subsites inherit the new V4.master I'd be very grateful.

This is only possible with a custom WSP or an HttpModule, both requiring .NET code. The Server versions of SharePoint handle this easily with the Masterpage option, a quick google search for "foundation masterpage solution" gave good results, including:
http://blog.thedesigndrifter.com/?p=1112
http://rickhilferink.wordpress.com/2011/01/25/creating-a-sharepoint-2010-foundation-masterpage-solution-and-automatically-activate-it-for-all-sites-and-newly-created-subsites/

If you'd like the ability to have a master page at the site collection root inherited by subsites, then you are best off using a publishing site template.
You can then go to: /_Layouts/ChangeSiteMasterPage.aspx and specify your custom master page, and have it inherited by all subsites.

this is probably too late to benefit you, but maybe it will benefit others. I have found that if you do not rename the customized master page to something other than v4.master, then subsites will not inherit the customized version of v4.master but use the original uncustomized v4.master instead. So make sure that you make a copy of v4.master and rename it. Here are some steps from [my blog post], this is how i did it:
Right-click on v4.master and select ‘Reset to site definition’ and the original v4.master will be restored, and SPD 2010 will automatically create a v4_copy(1).master page (screenshot 14).
Check-in custom.master, publish a major version, and approve the file
Go to Site Actions > Site Settings > Master Pages and select the new master page, custom.master, for both Site Master Page and System Master Page, and select the checkbox for ‘Reset all subsites to inherit this alternative CSS URL’ (screenshot 15)
Now if you have forgotten to activate the publishing feature for you new subsite with the Team Site template, it will not inherit the custom.master page yet, so go to Site Actions > Site Settings > Manage site features and activate the publishing feature (screenshot 16)
As soon as the feature is activated you should see the new master page and its styles (screenshot 17)

I solved this problem by creating new a custom site defintion by Visual Studio and SharePoint Site Definition. I added a feature which adds my custom masterpage (edited from
v4.master) into site collection's masterpage gallery (_catalogs/masterpage):
<Module Name="MasterPageModule" RootWebOnly="FALSE" List="116" Url="_catalogs/masterpage" >
<File Url="mymasterpage.master" Path="MasterPageModule\mymasterpage.master" IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary">
<Property Name="ContentTypeId" Value="0x010105"/>
</File>
The main thing to get the same masterpage for all sites is to set MasterPageFile -property in Default.aspx like this:
MasterPageFile="~sitecollection/_catalogs/masterpage/mymasterpage.master" - this refers always to rootsitecollection level.
I think that same thing can be achieved by using FeatureActivated-method, but it didn't worked in my case, don't know why.

Related

SharePoint 2010 v4.master Content Type

I'm taking over a SharePoint portal and noticed the previous developer used SharePoint Designer for all of the development whereas I use Visual Studio custom solutions/features for development.
NOTE: Site Publishing Features are enabled on a Team Site template for some web applications.
The issue I've noticed is the v4.master content type was changed from "Master Page" content type to "Page Layout" content type. This must have been done through the "Edit Properties" on the publishing site. When opening the site in SP Designer, the v4.master shows up in Page Layouts instead of Master Pages.
The v4.master also has the blue icon next to it meaning the page is customized and content is stored in the database which is causing performance issues. SharePoint is so slow that users are very frustrated. Also there are script tags in the masterpage pointing to jquery in the top level scripts directory. Personally, I would of created a delegate control for this instead of customizing the v4.master. NO Copy was made. (I totally dislike SP Designer, this tool gives too much power to inexperienced power users that like to put sharepoint developer on their resumes. I am definitely disabling SP Designer)
So, with all that said, what are the best practices or suggestions if any in fixing this issue?
What issues will this cause for future applications or site collections?
Should I develop and deploy a custom master as a feature then "Reset to Site Definition" on the v4.master?
Why does SharePoint allow users to change the Content Type on a Master Page to "Page Layout"? Why is this even an option, it doesn't even make sense?
All you need to do within the SharePoint Designer is publish the master page in the page layouts folder and approve it in the Master pages and page layouts in site settings. The master page will appear in the master pages section in SharePoint designer.

How can we change the complete look and feel of Sharepoint Portal?

by Default there are Themes, I don't Like those. How can I modify It completely and make a professional website. I have found same Questions on this blog but all for MOSS2007. I am working on Sharepoint 2010
The way I modify sharepoint, is as I do with almost every other CMS out there combined with the power of asp .Net (Remember that as CMS' go sharepoint is a poor solution if the only thing you want is a portal. Sharepoint is first and foremost a BI Solution).
When you edit your site in sharepoint designer (Site Action -> Edit in sharepoint designer) you can see a whole lot of options.
Here you can change the default masterpage to accomodate the look and feel of your site. You will do most of the hiding stuff here (those you don't want to be seen giving them the visibility=false attribute). Here you can also include a new CSS (place it in site assets) where you can override already existing css files.
From this point on, you will be able to add web pages to the site, that will conform to the masterpage, and thus you can use all the sharepoint power (web parts and even embedded html code) keeping the look and feel you have implemented on your master page.
So what you need to do is:
Modify master page in sharepoint designer
Add css files in site assets and include them in your masterpage
Add any other aspx pages or custom web parts that you will refer to in the sharepoint site
Create web pages with sharepoint assets, web parts or custom code
Enable anonymous access for the people you want to view your portal without authenticating (Bear in mind that there are some sharepoint controls that can only be viewed by logged in users)
There are multiple ways of customizing it.
My perfered way is CSS.
Add reference to a custom css in master page using feature
Modify the look and feel by modifying sharepoint out-of-box CSS
Following resources gives all the details of SharePoint 2010 css classes.
http://sp2010notes.wordpress.com/sharepoint-2010-css-chart/
http://sharepointexperience.com/csschart/csschart.html
I hope it helps.
Cheers.
Rajendra Shekhawat

Upgrade page layout with sharepoint feature

I use sharepoint 2010. I have a feature which contains some pages layout. When the feature is activated, page layout are applied. But when I deploy a new version of this feature with a new version of pages layout, page layout aren't take into considerations because they have the same name.
How can i do this ?
Your page layouts won't update because they're unghosted, i.e. customized in the Master Page Gallery.
It has nothing to do with the files having the same name unless you've explicitly set IgnoreIfAlreadyExists to FALSE in your elements.xml in the feature.
If your solution doesn't contain any important pages yet (development server or otherwise), the simplest solution is the following:
Delete the page layouts, (making sure no pages reference the page layouts in question, else you won't be able to delete them.)
In Central admin, uncheck "Allow Site Collection Administrators to Customize Master Pages and Layout Pages" ( see http://blogs.msdn.com/b/steve_fox/archive/2010/03/08/ghosting-unghosting-in-sharepoint-2010.aspx for details).
Redeploy your solution
See also http://blogs.technet.com/b/wbaer/archive/2007/08/10/ghosts-in-the-machine.aspx for a thorough explanation of ghosting and unghosting in SharePoint
Hope this answers your question.

Implementing a breadcrumb into your SharePoint 2010 website?

Has anybody any sample code or excellent article links showing an implementation of a breadcrumb navigation into a SharePoint 2010 Website?
Technet says this
Breadcrumb navigation displays a dynamically generated set of links at the top of Web pages, to show users their current position in the site hierarchy. By using SharePoint Designer 2010 or Visual Studio 2010, you can configure the breadcrumb navigation control. For example, you can specify a custom navigation provider, and you can remove breadcrumb navigation from a page layout.
This article discusses creating a custom navigation provider.
This is a control that you can add to sharepoint found on CodePlex (mavention)
OK,
here is a short HowTo for the mavention-breadcrumb deployment.
I had some problems doing it the way it's described on the blog and asked the developer for help.
So
1) copy the maventionsimplesitemappath.wsp solution to your website's BIN-Directory
2) add the wsp-solution over the sp_powershell (stsadm -0 addsolution …)
3) GoTo central server administration/farm solutions and deploy the solution we just added before
4) open the website's masterpage in sp_designer(or other) and insert the register- and control-code (you can copy/paste it from the blog above)
that's it!
If you still got porblems with permissions like I had some days ago try this(tipp from the solution-developer & blog owner)
open the website's web.config and search for the line <trustLevel name="WSS_Custom"..
open the policy file you can find in this line (wss_custom_wss_minimaltrust.config)
find lines <CodeGroup ...> maventionsimplesitemappath.wsp should be mentioned here </CodeGroup>
<CodeGroup class="FirstMatchCodeGroup" version="1" PermissionSetName="Nothing">
change the PermissionSetName to "FullTrust" if it's on "Nothing"
hope your permission-problems are solved now

SharePoint - My Site - Customization (Layout)

Is there a way to customize the layout of the default page on the My Site?
I know you can deploy a feature to push files into the hive to deploy a custom theme and a custom CSS, but what about the layout--where and which webparts show up for the user by default?
These both talk about customizing the look and feel:
Customizing MOSS 2007 My Sites within the enterprise
Customizing the My Site look and feel
But is there a way to build webpart zones and surface dataviews for lists, save those and have those pages come up as the default for when their My Site is initialized?
Most of the sites referenced here tell you to use a feature which changes the masterpage, which holds all your webpart zones, where they're located and what webparts are in those zones. After you've created a MySite masterpage which has the look and feel you want, you need to deploy the feature to switch masterpages. In addition, you need to add a feature which staples the original feature (which changes the masterpage) to any new site that is created. Inside your staple feature, you can specify which site types you want to staple the feature to.
Here is a good article which doesn't require you to write code, but does require you to create both of the features and deploy them: http://www.sharepointblog.com/2008/07/sp2007-custom-master-pages-on-subsites.html
The area where you'll want to pick out which site type the feature to change the masterpage applies to (what site type the feature is "stapled" to) is:
FeatureSiteTemplateAssociation Id="bb77f112-2cda-4e92-b0ff-820c0216a7fe"
TemplateName="STS#0"/> (this will staple it to the global template, any site created)
Here is a listing of the type of sites you can staple to: http://social.technet.microsoft.com/forums/en-US/sharepointgeneral/thread/721bec39-2d32-4bbc-9094-a021a0d06dcb
So, if you want to staple the feature to just MySites, you'd put this into your stapler feature:
FeatureSiteTemplateAssociation Id="bb77f112-2cda-4e92-b0ff-820c0216a7fe"
TemplateName="SPSMSITE#0" />
You'll notice from the example that I posted a link to above, the stapler feature references the masterpage switching feature by the Id you supply in the FeatureSiteTemplateAssociation part of you stapling feature.

Resources