Tag Info

Hot answers tagged

28

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" ...


11

I came across this link by Josh Gaffey that describes how to set the welcome page for a publishing site. The code I used is: ... // Create publishing page if (bPageCreated) { using (SPSite site = new SPSite(p_sSubSiteUrl)) { using (SPWeb web = site.OpenWeb()) { PublishingWeb publishingWeb = null; if ...


8

Let me see if I can explain pages in SharePoint without making you even more confused. The difference between the different kind of pages very much depend on whether your view is as developer or as end user. As you're refering to MSDN I'll start with the developer view. SharePoint Pages from a developer point of view From a developer point of view there ...


7

You can do this in code: Set the Welcome Page property of the RootFolder of a web. This property is available in 2007 and 2010 using (SPSite oSiteCollection = new SPSite("http://MyServer/sites/MySubSite")){ using(SPWeb oWebsite = oSiteCollection.OpenWeb()){ SPFolder oFolder = oWebsite.RootFolder; oFolder.WelcomePage = ...


6

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

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

First create your User Control and publish is to SharePoint. Then you register a tag for your control <%@ Register Tagprefix="MyControls" Namespace="KM.MyControls.MyControl" Assembly="KM.MyControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<Your token>" %> Then you can reference your User Control <MyControls:MyUserControl ...


4

If you place a FieldValue control on a Page Layout you can set this to display the value of a custom column using the FieldName property. For example: <SharePointWebControls:FieldValue FieldName="CustomFieldName" runat="server"/> Note you will need a reference to Microsoft.SharePoint.WebControls at the top of the page before this will work e.g. ...


4

Note: File can have multiple major versions but only one version can be published one! You cannot get published version by using CAML query. To do it by code you need something like this: // item is SPListItem object retrived by CAML query or some other method // there also some other options on how to get SPFile SPFile file = item.File; for (int i = ...


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

Add a page to the Pages library of your site, name it HomePage.aspx. Add whatever webpart etc. you need to it. Then, in the site settings of the site (_Layouts/AreaWelcomePage.aspx) set the url to point to your custom homepage. Now when someone enters the url of your site (ie. http://mycoolportal.company.local) IIS / SharePoint will point the browser to the ...


4

When provisioning Publishing Pages, you need to load an instance of the Template Redirection Page (found under SiteTemplates\SPS\default.aspx), but set the Url for the page to the name that you want to create, and set the properties such as content type and page layout in the normal way. Have a look at this for an example: ...


4

You could use PowerShell for this. The most tricky part is checking in/out and approving depending on what type of publishing is enabled, and weather pages are already checked out by others. Check out the stub code below. Included two methods to ensure that checkout and approve is done correctly depending on setup. A couple of things to note: BE AWARE ...


4

Normally, pages created in site/SitePages wont have the Publishing tab because versioning on these Library types are set to "Create major versions" . Major versions do not require Publishing as it creates a new major version when you check-in, save. Pages created in site/Pages will have the publishing because that Library type is set to create "major and ...


4

SP.File.checkOutType property gets a value that indicates how the file is checked out of a document library Get file checkout type via REST $.ajax({url: "/_api/web/getFileByServerRelativeUrl('" + pageUrl + "')/checkOutType", headers: { "Accept": "application/json; odata=verbose" }, success: function(data) { ...


3

So it really boils down to a few things. First, when you create a Publishing site you will have complete control over the master page and page layout experience. Another words, if your requirement is to build a public facing web site you would want to create a Site Collection based off the Publishing Portal template that is available. You can control page ...


3

If I understood your question correctly you are looking for a way to hide left navigation (Quik launch) on most of site pages and show it just on pages of certain page layout. Important thing here is: What is commonly used scenario (or default scenario): navigation is visible or navigation is hidden? (I am assuming navigation is hidden) The simplest ...


3

My first thought was also for a Wiki site. When you get up to 2010 you get some added value in that you can use enterprise tags for the pages and users would also be able to leave notes/comments using the social features if you are using the Server version. The second option and something I did frequently in previous versions of SharePoint was a FAQ list ...


3

Simplest possible code to just get page and folder names is: using(SPSite site = new SPSite("http://myCoolSite")) { using(SPWeb web = site.OpenWeb()) { SPList pageList = web.Lists["MyCoolPageLibrary"]; // Get items foreach(SPListItem item in pageList.Items) { // item.File.Name } // Get ...


3

You have to use SiteDataQuery as replied by Thomson above. Here is some sample code SPWeb web = SPContext.Current.Site.RootWeb; SPSiteDataQuery query = new SPSiteDataQuery(); //Server template for page library is 850 query.Lists = "<Lists ServerTemplate='850' Hidden='TRUE' />"; query.ViewFields = @"<FieldRef Name='URL' Nullable='True' ...


3

If you're using SharePoint 2010 you can use List validation: Make sure your Page layouts include "Scheduling Start Date" Go to the Pages library Select List settings in the Library tab of the Ribbon Select Validation Settings Enter a formular like =[Scheduling Start Date]>TODAY() Enter an appropriate user message like "Page must be scheduled into the ...


3

I would suggest the use of native policies (like in our case the expiration policy) that you can attach to a specific content type and trigger an action / workflow when the policy is met. In this case it will be when an item's age is reached. (eg : http://technet.microsoft.com/en-us/library/cc262112%28v=office.12%29.aspx) What I've been doing for a customer ...


3

I prefer not to create sub-sites for navigational structure alone - mainly because it is hard to change the structure again. But you actually have some good alternatives when you are willing to create a custom navigation data source. Below are two options that will also not require you to create folders in your Pages library. They also make it harder to ...


3

You can use a standard HTML redirect with a wait period of 0: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Redirecting...</title> <meta http-equiv="REFRESH" content="0;url=http://www.yoururl.com"> </head> <body> </body> </html> Changing the ...


3

I had the same issue on a Publishing Page Libary. I set the toolbar to No Toolbar on the AllItems.aspx page. Removing the toolbar causes the page to stop processing. Browse to the AllItems.aspx page and edit the page > edit web part > check tool bar type. Set to Full Toolbar and save. This should resolve the issue.


3

They're both working, thanks! I've found another way, a little faster because it doesn't need to call the server back again, but it can only to determine if the file is checked out by the current user, not by a generic user. I've found a way to achieve this, tested on Sharepoint 2013. Just add the following script inside a script webpart after putting ...


2

Also you have hit upon a weakness in the WCM features in MOSS 2007 because you cannot have folders in a pages library. The content would have to be oragnised using content types and page layouts. However in SharePoint 2010 you CAN have folders in a pages library and furthermore you can use the Content Oragniser to automate the process of 'filing' your ...


2

Although not particularly AJAXy, the "Manage Content and Structure" page, which is available for Publishing site collections, does allow you to create/delete/move sites and pages within your site collection.


2

Theres some security issues here to consider as well. Say we had the option to insert (and hence upload) images using copy/paste, where would these pictures reside? The fine grained security model of SharePoint give administrators the possibility to delegate security related tasks, such as being responsible for uploading corporate approved images. In other ...


2

This would be using the Document Conversion Service, wouldn't it? I can't imagine why you'd want to convert an existing Publishing Page to ... a Publishing Page. It think that overload might be for Document conversion. I would suggest uploading to a document library and then invoking the Document Conversion service. I have added a page programmatically - ...



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