Tag Info

Hot answers tagged

21

I have resolved the same issue using the my post. In Feature.xml add a reference to the Feature receiver class. <?xml version="1.0" encoding="utf-8"?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Id="{35867BDA-82DC-418c-9005-79CCC363E3CD}" Title="blah" Description="blah" Scope="Site" ...


12

If you want to do it at page level, you can assign a different master page on "OnPreInit" event. Below is the example to do it on layout page if you have publishing site : public class MyPublishingLayoutPage:PublishingLayoutPage { protected override void OnPreInit(EventArgs e) { base.OnPreInit(e); if ...


7

My question is why on earth you'd want to remove core.js. It contains JavaScript functions which are useful even in a public-facing situation, and that's why you are getting errors. These include dropdown menu items, page layout manipulation, expand/collapse behavior on list views, etc. Remember that core.js will only be downloaded once per user when they ...


7

You have a couple options here (...I've used both successfully in the past): 1) Call _spBodyOnLoadFunctionNames.push("function()"); replacing function with the name of the function in your webpart. This will cause your function to be executed after the body of the page if fully loaded and in sequence with other startup client-side scripts. 2) You can go ...


7

There are many ways that you can approach this issue and it all comes down to what the desired functionality and behavior is for both the user and the content editor. One of the most common ways I have done this in the past is to use one master page that has all the publishing controls still in it. By default you have to be logged into a site for it to ...


6

If your goal is to have a different look and feel for different users, you can use a single Master Page, and include steps that only target specific profiles (anonymous users in your case). Search the internet for the following terms: SPSecurityTrimmedControl and AnonymousTemplate. It is what I use on this draft page: http://usermanagedsolutions.com For ...


6

This is a common problem when using multiple JavaScript libraries as many of them define $() SharePoint is using ASP.NET Ajax so if you include JQuery you should do that in noConflict mode. You turn that on using jQuery.noConflict(); Now $ will never mean jQuery unless you use constructs like: jQuery(document).ready(function($){ /* code using $ */ ...


5

You can navigate to the master page gallery via the root site Site Actions>Site Settings>(Galleries)Master pages and page layouts. Then select the master page file you want and click Download a Copy from the ribbon. The url for the master page gallery is: http://server/_catalogs/masterpage


5

First of all, never, ever modify v4.master. That is a Microsoft page and will likely be replaced/updated in a future service pack and then poof, there goes your master page :) Create a copy of it and use that instead. If you put the web parts in the standard web part zones in the master page, all new pages that do not have content defined for those zones ...


5

In the most concise terms I can think of - a Page Layout is used to display content, a Master Page governs the look and feel for the whole site. A Page Layout has an associated content type, therefore it stores content, and a page derived from a Page Layout will store the content in the content type's fields. A MasterPage does not have a content type and ...


5

As long as you dont customize (unghost) your page layout, updating through declarative feature should work fine. By any chance did you create your page layout in SharePoint designer? If you did, a little known "feature" is that even though you provision your page layouts with GhostableInLibrary they will be unghosted and hence you will only be able to take ...


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

Is the JScript running server or client-side? If server-side, SharePoint's safe mode parser will block the request. This is SharePoint's protection mechanism to deal with the fact that end users can add content to SharePoint pages. If client-side, it could be the same issue, I'm not 100% sure. Assuming it is indeed the safe mode parser which is preventing ...


4

The Communitiy Kit for SharePoint changes the master page dynamically. You can find a code sample in the latest CKS changset. Drill down to EBE -> CKS.EBE -> CKS.Blog. It is in the BlogHttpModule.cs in the BlogHttpModule_PreInit method. You will need to add the HttpModule to the web.config. For an example of that, check the WebAppFeatureReceiver.cs in the ...


4

Heather Solomon's site should be your first port of call, has everything you need to know about customising the look and feel of SharePoint. http://www.heathersolomon.com/blog/ EDIT: this is mostly 2007, but most of the principles are the same for 2010.


4

Please, try to add List="116" attribute to your Module element, as it is shown in this MSDN how-to: http://msdn.microsoft.com/en-us/library/ms441170.aspx <Module Name="MasterPages" List="116" Url="_catalogs/masterpage"> <File Path="MasterPages\custom_main.master" Url="custom_main.master" /> </Module>


4

Try to forget the past and get comfortable with SharePoint Designer. It is not perfect, but it is a useful tool to have available, and is greatly improved over the 2007 version (and FrontPage ;-). If you want a master page for your solution package, a good way to do it is to work in SPD to do the editing until you get what you want, then download a copy to ...


4

You need to update your page layout programmatically. You have two options: Overwrite existing page layout: Updating a SharePoint master page / Page Layout via a solution (WSP) Deploy another page layout and replace all of its usages: Programmatically Update Page Layouts


4

You can use two options only for targeting content to users (not change of master page): Audience for Server version - http://www.codeguru.com/csharp/.net/net_data/sortinganditerating/article.php/c13255__2/ and for 2010 but the concept seems to be the same in 2010 - http://blog.mastykarz.nl/content-targeting-anonymous-users-sharepoint-server-2010-part2-2/ ...


4

The best approach is to use main master page (with only test pages attached) placed in a document library, and track changes to the file made using SPD and if any changes are made - update ghosted master page in file system accordingly, all other master pages are deployed via modules and are ghosted versions of one in files system. After changing file ...


4

As Sig suggested there are some changes to the way IE9 handles javascript from previous versions. I found my answer in /_layouts/1031/init.js in the function ProcessImnMarkers() (Ironically, a function you want to overwrite as empty if you actually WANT to hide the IM Presence stuff). Here is the original code of the function: function ProcessImnMarkers() ...


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

You need to create a custom HttpModule. Check this sample out: http://www.thelineberrys.com/default-category/using-your-sharepoint-sites-master-page-on-all-application-pages-3.html


3

There an easier way to do this using the SharePoint API: SPWeb web = SPContext.Current.Web; PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web); publishingWeb.CustomMasterUrl = "/_catalogs/masterpage/mycustom.master"; publishingWeb.CustomMasterUrl.SetInherit(true, true); publishingWeb.Update();


3

If I understand the question right, you should be able to work with the SPUrl expression builder by instantiating it in code, obtaining the expression result, then doing whatever you need to do. Alternatively if you're trying to work with an existing instance, you should be able to get it in the code-behind by ID, though you'd need to pay attention to when ...


3

Check out the SPUrlExpressionBuilder class http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.webcontrols.spurlexpressionbuilder_members.aspx


3

The content loaded within the SPModalDialog UI ("lightbox" as you put it), loads your full master page. It's basically the same page within the modal window and elements containing the s4-notdlg class are hidden (as SPCloudGuy mentioned). This is the process for hiding any element(s) from your master that you don't want displayed inside the modal window. If ...



Only top voted, non community-wiki answers of a minimum length are eligible