Hot answers tagged master-page
5
You should have Type="GhostableInLibrary" attribute for your preview.
I suppose MasterPages in your solution points to a document library. If you want to provision files from a module to a document library, ghostableinlibrary type must be used:
Specifying GhostableInLibrary means the file will be added to a
document library in SharePoint together ...
4
The line <Property Name="QueryPromptString">$Resources:MyResourceFile,ResourceKey</Property> wokrs fine for me.
I think that you should check your resources file. This file should contain ResourceKey which you tries to use in this property.
If you use correct resource file and key, the search control displays text depends on the site language. ...
4
In the head section of the master page you need to define a tag prefix in the style of:
<%@ Register Tagprefix="Yourwebpart" Namespace="yournamespace" Assembly="yourassemblyname, Version=1.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Also don't forget to change the PublicKeyToken and version number.
In the location where you want to ...
4
Try this for the first link as it is intended to address exactly what you are seeing, though certain controls do not expand the value.
<CustomAction Id="script1" Location="ScriptLink" ScriptSrc="~SiteCollection/Style%20Library/mySolution/custom1.js" />
As to whether it should be in _layouts or Style Library is a debate that has raged since the ...
3
A simple PowerShell script would do it. There's a MasterUrl and CustomMasterUrl property on the SPWeb object, so you could just do something simple like Get-SPSite | Get-SPWeb | % {"Site: " + $_.Url + " Master: "+ $_.MasterUrl} to list out the master for every web.
3
You can't. The syntax for @ Register with a user control is:
<%@ Register tagprefix="tagprefix"
tagname="tagname"
src="pathname" %>
Where
src
The location (relative or absolute) of the declarative ASP.NET User Controls file to associate with the tagprefix:tagname pair.
tagname
An arbitrary alias to ...
3
The short story:
Usually you'll set the master page as both default and custom master page, the most common exception being a very customized master page for publishing which can't be used for ordinary pages in which case you'll only set it as custom master page.
The full story:
When creating pages in SharePoint your main options for setting the ...
3
Yes. You can put your master page in the SharePoint Root. And yes, editing with notepad may cause issues. There are a few good reasons to avoid this practice.
Updates from Microsoft may overwrite or delete files in the SharePoint Root
SharePoint is designed to support multiple web servers deploying the necessary files to the SharePoint Root pulled from the ...
3
To use Client OM, you need a reference to SP.js
For production:
<SharePoint:ScriptLink Name="sp.js" runat="server" OnDemand="true" Localizable="false" />
For development purpose:
<SharePoint:ScriptLink Name="sp.debug.js" runat="server" OnDemand="true" Localizable="false" />
Moreover, there is also another way to declare it using the ...
3
Starter Master Pages is a great resource for learning about SharePoint 2010 master pages and a good starting point for SharePoint 2010 branding projects
From _starter_publishing.master
<!-- s4-ca is the main body div -->
<div class="s4-ca">
<div class="s4-notdlg">
<!-- links for I like it and Tags and Notes ...
3
Why would you not use the fact that _catalogs is a virtual directory in SharePoint and reference it like this:
<scrit type="text/javascript" src="/_catalogs/15/masterpage/Display%20Templates/Filters/Filter_Default.js">
</script>
(notice the slash at first, and the 15 telling Sharepoint to look at the 15 hive instead of the 14 hive from 2010)
...
2
Including the navigation in this way effectively bypasses the SharePoint mechanisms for highlighting the current tab so you will have to roll your own.
One approach would be to use jQuery to iterate through the urls in the nav (perhaps ".top_nav li a") and compare the url in the each link to the current window.location.href to find the best match. Once ...
2
Hi custom master page is site master page used for publishing pages only and default master page is system master page, to know more please leaf through this article
http://rehmangul.wordpress.com/2009/12/15/master-pages-in-sharepoint/
2
I think you can! Someone on msdn posted the following:
Audience Targetting
I'd recommend at dividing your users into SharePoint groups. You can
then use Audience Targeting to set who can or can not see specific
links (Site settings > Navigation). For audience targetting, you
target SharePoint groups, AD groups or specific users. Please
...
2
The "SharePoint" way to do this is to:
insert an empty <Delegate> control in the Master page
create a User control with the search bar
create a Web scoped feature with a <Control> element inserting the User control in the delegate control
activate that feature only on the root site
See Delegate Control
So to match your updated question you ...
2
You can turn on the Publishing feature for the Root site and in the Site Action -> Site Settings -> Master Pages you will see a screen like below:
Here you can specify to inherit the root-site master page for sub-sites!
Also, if its just a CSS that you have used - at the bottom you can see an option to Specify a CSS to be used by this publishing site and ...
2
You are only setting the property on the root SPWeb object, that property is not accessible or propagated down to sub sites.
If you want to apply your master page you will need to write some code in your feature receiver to enumerate child SPWebs and set the property on each child, don't forget to call update on each SPWeb.
2
2 Choices:
Get the template and edit the TEMPLATE/templatename/xml/onet.xml file to add the master page link manually (I would make a new VS project from this file and deploy it rather than edit it in the hive even though you can, this is purely because then you have a deployable copy of the template)
<Configurations>
<Configuration ID="0" ...
2
I general you will find all on my blog that needs to be done: http://www.n8d.at/blog/centered-fixed-width-design-in-sharepoint-2010-the-fast-way/
What you need to do is:
div.s4-title.s4-lp,
body #s4-mainarea,
#s4-topheader2,
#s4-statusbarcontainer{
margin: 50px;
padding: 0px;
float: none;
background-image: none;
...
2
Please look at the answers on this question too. It is a complex topic, with no "correct" answer. I think Chris O'Brien summed it up pretty well in his answer.
My personal opinion is, that it depends :) In your case, since you want to use the same .js file in two (or more) site collections, I would definitely put it under "_layouts".
Another question is: ...
2
One option would be to use powershell to iterate through the site collection. Something along the lines of this:
$site = Get-SPSite "http://site.domain.com"
$webs = $site.AllWebs
$webs | % {
$obj = new-object System.Object
$obj | Add-Member -type NoteProperty -name WebUrl -value $_.Url
$obj | Add-Member -type NoteProperty -name Master -value ...
2
As far as I can tell there is no such state as no composed look (or theme) in SharePoint 2013. To reset a composed look back to normal, choose the Office composed look and leave all the settings set to the default. This is the out of the box look and feel.
-Randy Drisgill
MVP SharePoint Server
blog.drisgill.com - @drisgill
2
I can see several issues here:
1. I fail to understand how come you have so many master pages, as for sure (unless you have a specific business scenario) you shouldn't have that many. In either case, do NOT modify the out-of-the-box.
2. If you by "script reference" you mean some JavaScript, there is a simpler, better way starting SharePoint 2010, and that is ...
2
As per MSDN:
You cannot add Web Parts in zones to a master page. You can add static Web Parts (parts outside of a zone) to a master page, but you cannot add dynamic Web Parts to master pages.
The better way to do this is using Delegate Controls and the AdditionalPageHead delegate control can be the best candidate as it is available in all OOB master pages.
2
I think your URL is wrong. It should be just
<img src="/Style Library/Images/logo.jpg" />
If you want to have it accessible from another sitecollection I suggest you deploy the image to the "/_layouts/images" folder instead. Thereby you can alwas reach it by just using the relative URL:
<img src="_layouts/images/logo.jpg" />
2
Sharepoint has tokens you can use which will be replaced at runtime
~site – Web site (SPWeb) relative link.
~sitecollection – site collection (SPSite) relative link.
Agree with Robert that you would probably want to deploy it to the layouts folder.
The url you have given points to a specific library, unless you're planning to deploy the logo to each site ...
2
I presume that you have your JavaScript files stored in the hive files? if so it would be under the layouts folder! and also that you have set annoymous access to the whole site means that by default annoymous users dont have access to the layouts folder! its a saftey feature!
hence why logged in users have access and can use the JS file whereas annonymous ...
2
What I suggest to you for the mobile view is to use a responsive design, you just need one masterpage and the css will adjust the content to the size of the browser based on media queries.
to follow this approach you will have to disable the mobile view, here is a well explained method ...
2
Going to leave this up here for anyone that might come across it as I've just worked out what it is.
Settings.aspx overrides the content placeholders that my nav control is in:
PlaceHolderTopNavBar
PlaceHolderHorizontalNav
I've just simply brought the nav control outside of these placeholders and hidden the placeholders (settings.aspx will put the nav ...
1
Take a look at CodePlex. There are many things there to enhance SharePoint.
http://sharepoint2010html5.codeplex.com/
http://sp2010metro.codeplex.com/
Only top voted, non community-wiki answers of a minimum length are eligible


