Site theme specific to sharepoint site collection? - sharepoint

How can we restrict a site collection and its subsites to a particular site theme or set of themes?

If you have the Publishing enabled, you have a Master Page link in the Look and Feel section in Site Settings. You can force all subsites to inherit the masterpage from the top site, making the theme applied to that master page the one to show on all subsites, no matter what theme they have.
Also http://stsadm.blogspot.com/ has an extra option to stsadm that lets you apply a theme recursively.

Related

sharepoint 2013 top navigation menu with sitecollections

I have a SharePoint Site called ProxymGroup which has multiple affiliates and departments.
I created the webApplication and added 2 managed Paths of type WildCard called Affiliates and Departments.
Under affiliates i needed to create 3 site collections and under departments 2 other SiteCollections. So, here i have the links for the siteCollections:
http://MyHostName/affiliates/SiteCol1 ... and http://MyHostName/departments/SiteCol1 ... etc.
My goal is to display all that hierarchy in theTopNavigationBar menu of the siteCollection because when i activated SharePoint server publishing feature and checked Show SubSites in navigation tab under site sittings it only showed me the subsites, not the siteCollections created under this site.
How can i do please to get that hierachy shown in my TopNavigationBar menu???
Thanks in advance
as far as I know there is no ootb way to show information in the navigation shared among site collections. each site has its own master page and can only display subsites, not other site collections.
alternatively, you can create a powershell script that sets the same navigational items for all the existing site collections, adding links for all the existing sites in all menus of all sites
...or just create subsites
Go to Site settings -> Look and Feel -> Navigation and you can add links manually and change the hierarchy as you want , Please check below image for same.

Hide CustomAction in SiteSettings page at subsite level

I have two features that add CustomAction to the SiteSettings page. One feature is at the Site level and the other is at Web level.
The CustomAction that is being added at the Site level is a link to the custom configuration page that manipulates Site level settings for my application. Therefore, I don't want the link displayed for the SiteSettings page of a subsite. I know there is a setting (RequireSiteAdministrator) that hides the page according to access level, but I would still like to have this page show up for Site owners at the top/root level site settings page and not in the sub site level setting page.
There is a RootWebOnly attribute for the CustomAction xml node which would solve my problem. The problem with this attribute is that it only available for SandBoxed solutions.
I know that this is possible, since I see the behavior for the Site collection administrators link in the Users and Permissions section of the Site Settings page. Please notice that if you go to the top/root level settings page, you will see this link. On the other hand, if you navigate to the Site Settings page of a subsite, the link is no longer there.
I have tried using HideCustomAction, but this hides the link on both pages.
After battling with this for two day, I had an ah moment that I thought I would share. This will allow you to place a custom action that will show only at the root web level.
Create 2 features. One at the site level (siteFeature) and one at the web level (webFeature).
Make the web feature hidden so that it can't be accessed (activate/deactivate) though manage features page.
Put the custom actions element xml in the web feature.
In the activation event receiver of the site feature, activate the web feature.
UnfortunlyUnfortunately this is not possible with custom actions and custom group.
All you can do is just to set up permissions on the link that will be shown only to SiteCollection Administrator
Example how it will be is "Site Collection Administation" group where links are hidden when you are not on the top site level and shown when you are.
Hope it helps,
Andrew

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.

Sharepoint Foundation master pages on subsites

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.

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