Community Page
- SharePointMagazine.net/ Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- Hi Michael, Thanks again for another awesome post. I've been wondering how we can expand our SharePoint farm in an eco-friendly manner. I'd like to explore using VMWare ESX Server or...
- Hey Bill, The best place to deploy CSS files is in the Layouts folder of the 12 hive (usually: Program Files\Common Files\Microsoft Shared\web server extensions\12\Template\Layouts). The...
- Hi Greg, Great article. I have a master page ready but it uses a special css file in conjunction with core and others. What is the best way to deploy my special CSS file and where? Should I list it...
- Pingback from PJonDevelopment. http://tinyurl.com/ldpmer Nice tutorial.
- Great series. I'd like to add that not only are we virtualising our WFE's and application servers but also the database role on SQL 2008 running on ESX infrustructure. The key with...
SharePoint Magazine
SharePoint Magazine is an online magazine dedicated to the world of SharePoint and related Information Worker technologies.Deploying the Master Page (Master Pages and SharePoint part 4 of 6)
Started by Arno Nel (SharePoint Magazine) · 8 months ago
This is the fourth article in a six-part series on ASP.NET Master Pages and SharePoint. In the previous article of this series we discussed how to build a customized master page in SharePoint Designer. At the end of the previous article we discussed that making the modifications directly in SharePoi
... Continue reading »
8 months ago
Do they need to be put in elements and feature xml file?
8 months ago
There are two ways to do this. The easiest way is to add the image to a folder in the 12 hive under the Layouts directory. At that point you can reference the image in the Master Page with _layouts/{folder name}/{file name}.
The other way is to put it in an image list on the root site of your page. Then you can reference them in an image tag like so: <img runat="server" src="<% $SPUrl:~SiteCollection/Style Library/Imagename.jpg%>" />
The advantage of putting them in a list is that you can manage the image in the SharePoint list moving forward. The advantage of putting them in the 12 hive layouts folder is that it is real easy and that is the way SharePoint does it with the default images.
To incorporate the layouts approach, you just need to make sure the image gets moved to the 12 hive layouts folder. You can either manually move it there, or you can have a solution do the move for you. We will talk more about this in the last article in this series.
If you do the image list approach, you can either just put the image in the correct list. Or, if you want everything to be done automatic, then you could create the list as a featre and add the image when the feature is being created. However, that is a complete other subject (i.e.: creating lists and list instances as features).
8 months ago
Thank you for this great article.
In the 11th step in the "Create Feature" paragraph, you missed filling a link. See {insert link here} tag.
Regards,
7 months ago
Good stuff. Question. I wrapped this up as a solution (.wsp file) using wspBuilder. It deploys cleanly into sharepoint, but the feature does not show up to activate/deactivate on the site. Do you know what I could be missing?
Thanks
7 months ago
The last article in the series will address it. But, your issue is around the onet.xml file. There is a "<SiteFeatures>" node and a "<WebFeatures>" node in that file. You have to put the feature id of your feature in one of those (depending on if it is a site or web feature.
Hope that helps,
Greg
6 months ago
Question : is there a way to list all the deployed Features ?
sthg such as:
stsadm -o enumfeature -url http://mysitecollecitonpath
?
thanks.
4 months ago
Sorry it took me so long to reply. I don't get emails sent to me from here when someone leaves a comment. I don't know of an stsadm command to do that. But, you can build your own stsadm commands or you could build a simple winform to do that. Then, all you would have to do is loop through the sites and sub-sites. On each of those objects (SPSite and SPWeb), there is a list property called Features. If the feature is in that list it has been activated for that site.
That will show you the activated features.
If you are just look for all the deployed features, that is easy too. You can loop through the feature list of the farm. Just get a reference to SPFarm and loop through it like this:
foreach (SPFeatureDefinition feature in SPFarm.Local.FeatureDefinitions)
That will tell you every possible feature definition that has been deployed on the farm (whether it is active or not)
4 months ago
one suggestion since we get emails from comments made one comments : create a 1st comment for your new post and ask to comment as a reply to it. .. until they enable email notif for the blog writer ;-)
4 months ago
If I might suggest, getting such lists is a snap using powershell.
I recommend a Google search for "Powershell Extensions for Sharepoint"..
Cheers,
-MV
5 months ago
Thanks again
4 months ago
Sorry it took me so long to reply. I don't get emails sent to me when someone leaves me a comment here. I agree - it is cumbersome. But, there are actually good architectual decisions on why everything was setup this way. If you understand "every" situation in SharePoint, it actually makes sense.
One thing I do is set up all my plumbing in a solution. Then, whenever I go on a project, all I have to do is edit the master page and all the deployment plumbing is there for me. So, the cumbersome part was done a long time ago for me and I can concentrate on my customizations each time.
3 months ago
3 months ago
The previous article in the series contained the sentence "Please not the intent of the above change is to show that the out of the box SharePoint controls can be changed." Do you mean 'note' rather than 'not'?
If you don't know English syntax, why should I trust your SharePoint syntax?
Really this is a subject I wan't to understand and I'll wade through it, you just keep forcing me to slam on the brakes as I read.
3 months ago
As the author of this article, I would like to mention it is a blog. And the blog prgram is what caused those #8220 in the view source. There is not much I can do about that, this blog takes articles from multiple different authors, so I have no control over the program. I would suggest you contact to owner of this site rather than leaving a comment for one of the participants.
As for the mistake in the previous article. I just have to appologize. It was a key stroke mistake. It had nothing to do with lack of knowledge around "English syntax".
Also, just so you know, this is all community driven, it is not a pay site. I volunteer my time. It has helped a lot of people. And, writing in blog's is very hard to do. I don't know if you have ever used a blog editor before. They change symbols on you sometimes and they make it very hard to proof read. So, please be gentle on people volunteering their time. These kind of comments make people not want to volunteer anymore.
1 month ago
Once you deploy the master page this way, it will get unghosted if you then try to edit it with SharePoint Designer, correct? And then you'll have a different version in the database than what you have sitting in the 12 hive? I like this method, but I'm trying to figure out what's the best way to go. I have A LOT of customization to do for the master page... And I want to make sure it's easy to deploy on Dev, Production, and in the future. Do you recommend against using SharePoint Designer for the master pages? Aren't there benefits to using it?
Thanks!
1 month ago
If you edit it in SharePoint Designer it will get UnGhosted. But, if you just deploy it this way with a feature, then it will stay Ghosted. So, SharePoint Designer editing is what makes a file UnGhosted.
I think the best way to go for doing A LOT of customizations to master pages is either the route dicussed in this series (i.e.: packaging up a site definition - keep reading this series of articles to get to that) or using feature receivers (I didn't cover feature receivers in this series of articles because it was getting long). You make the decision of feature receivers vs custom site definitions based on whether you want to utilize the out of the box site definitions, of if you need completely custom ones to do other stuff like changing the zone configuration or the default lists and webparts.
Either way you will utilize a WSP package to do your deploy.
The packing up in a WSP to deploy is the best reason to use solutions over SharePoint Designer. The Unghosting aspect is a secondary reason. So, yes, I do recommend against SharePoint Designer for deployment reasons. However, I do use SharePont Designer to "design" my pages on a test site. Then, after I have finished designing them, I move them into this solution methodology so I can deploy to multiple environments.
Hope that makes sense,
Greg
1 week ago
Great article. I have a master page ready but it uses a special css file in conjunction with core and others.
What is the best way to deploy my special CSS file and where? Should I list it in the elements.xml? I want the new master page (and it's css) to be available to all sites in the collection.
Thanks
Bill
1 week ago
The best place to deploy CSS files is in the Layouts folder of the 12 hive (usually: Program Files\Common Files\Microsoft Shared\web server extensions\12\Template\Layouts). The interesting thing about the layouts folder in the 12 hive is that SharePoint creates and IIS path to that folder with "_layouts". So, you can reference things in that folder by placing "_layouts/{path to css}" in your html.
Another option is to put the css files in the style library/list in the actually SharePoint site. This is a good option if you want to modify css directly in SharePoint.
I usually choose the Layout folder option for the following reasons:
1. It is real easy to deploy
2. It is how SharePoint does it's css files
3. There is some caching going on with that Layouts folder which can give you some performance help (but - this is minimal)