Hot answers tagged publishing-site
10
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
I have to disagree with James.
The SPContentType in SharePoint 2010 has a new constructor that lets you specify the content type id.
The addition of the Inherits attribute of the ContentType element makes the behavior of content types described in CAML inconsistent.
Finally, the Feature upgrade mechanism is great if you are adding fields but it doesn't ...
5
try to use this query:
SPQuery q = new SPQuery();
q.ViewAttributes = "Scope=\"Recursive\""
q.Query = "<Where><Geq><FieldRef Name='CheckoutUser' LookupId='TRUE'/><Value Type='int'>0</Value></Geq></Where>";
var pages = pagesList.GetItems(q);
4
Master Page is where you need to place these items, because it defines the look and feel that all the pages in the site gets and by placing that you will have the changes reflected in all the pages of the site.
Register Tag has to be placed at the top of the Master page where you see other register tags.
And the second set of code needs to be in the bottom ...
4
Here are the options for workflows in SharePoint 2007:
Out-of-the-box. These are described at Office Online. They are limited in options but require no additional tools.
SharePoint Designer. These are a lot more flexible and created using a wizard interface within SPD. Here's a video tutorial, and MSDN reference, you can search for many more resources.
...
4
Well, it sounds like you are using the publishing features of MOSS. With the publishing features you have a page layout that is applied to a page. You will not be able to edit this page directly except through the UI by adding webparts or changing values in the field controls. When you try to edit a page that is using a page layout in SP Designer, it will ...
4
Could you tell a bit more on what part of the object model you are using?
If you are coding navigation api, theres other better approaches with the whole sitemap provider framework (like PortalSiteMapProvider).
If you just want the current information in general, you can always use SPContext.Current to get hold of data like current web, site, list, ...
4
Publishing portal is typically used for web content management (internet sites), Collaboration portal is typically used for intranets.
Publishing portals contains but a subset of the lists, libraries and subsite templates types you find in Collaboration portal site definition template. Collaboration templates on the other hand contains the lot! You got ...
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
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 ...
4
There are (at least) three ways of achieving this in SharePoint 2010.
1) Custom Site Definition. They are hard-core and somewhat old-school, and require access to the file system. Generally we try to avoid these nowadays, other than as a simple one to be used for feature stapling.
2) Site Template. Now a realistic option because of the new Web Template ...
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
rjcup,
Your client is likely not the right entity to ask what solution is best. If you're the developer, then you should know best and if your client doesn't trust your judgement, then your client has a problem much greater than how to get something done. If that client knows more about SharePoint than you do, then you have a quite different problem as ...
3
use Reusable Content.
100% out of the box
Insert an entry in your Reusable Content list and insert/reference it from a Rich Html field control on both pages (it's your responsibility to place the Rich Html field controls in the right position on your Page Layout or Master Page).
You have the option to specify whether you want the content on the pages to ...
3
Try this:
Go to Site Actions, Manage Content and Structure.
Click the View menu and change to:
Checked Out To Me for drafts that needs to be checked in (unfortunately there is no built-in filter to check for all drafts)
All Draft Documents for pages to be published
Pending Approval for pages to be approved
Click the 'select all' icon above all of the ...
3
Can't you just change the Web Site name from "inc" to "Main Page"? If that isn't right for you, thern you could put a snippet of jQuery in the master page to find and replace the "inc" text.
Update:
Here's a real life example. On the Home Page of SophiaThink Consulting's site, we're using the Smiling Goat RSS Web Part. There's no way with that Web Part ...
3
If your data is in a SharePoint List, you could just create a view on the List that is specifically of type DataSheet with the appropriate columns, go through the steps of adding a Web Part to your page (Site Actions-->Edit Page...) picking your SharePoint List which will use the default view initially, then choose Modify the Web Part from its dropdown menu ...
3
Changing content in a single page could be done in many ways.
For code changes in several pages http modules would not be my first choice (it would probably be one of my last due to performance depending on what needs to be done).
Much more elegant (and less intrusive) methods exists, such as code behind in master page or page layout or inheriting from ...
3
That information changes dynamically does not mean you have to use a web part.
Use web parts when you
-need designer/contributor to change the default functionality by either adding web parts or change properties on web parts without having to involve a developer
-have a specific reason like using it as filter web part, connected web part, caching etc.
...
3
I think a webpart will work either way, because a webpart is just a more advanced webcontrol. I would do it one of two ways:
Add it to the master page or page layout using SP Designer.
Add it to every page programmically using a feature
1 is if you need the webpart to exist where there isn't a webpart zone. You'll need to make the change to every ...
3
This is a difficult topic to describe in words only. I recommend you take a look at this link which I think does a great job of illustrating how to manage host headers, alt access mappings, and even ssl if applicable.
...
3
The reason there is no template for the Pages library is because a lot more is required to support publishing pages. What needs to happen is that the 'publishing' feature is activated on the site - this will create the Pages library and other supporting artifacts. Note also that a pre-requisite is that a similar 'publishing infrastructure' feature is enabled ...
3
The SharePoint object cache is stored in memory, which is why an IISReset clears it down. Depending on how you restored the site, I'd probably expect to need to do an IISReset after such an admin operation.
More details on object caching here:
http://technet.microsoft.com/en-us/library/cc298466.aspx
3
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.
...
3
Creating a template from Publishing sites is not supported as the templating function relies heavily on content types and other items that may not be available when you create a new site from the template.
Like you I've tried the workaround from 2007 by navigating directly to the Template creation page, which does work, but I've never succeeded in then ...
3
The problem is that in SharePoint, you have no idea how many web servers is running your site, and therefore you've no idea how many web.config's could be running (not you in particular, but in general, SharePoint can handle dozens of web front end servers). In order manage changes to the web.config file, the object model is design such that any and all ...
3
Deploying content types via the elements.xml allows you to define content type Ids as well as your site column IDs (which you can't do via the API unless you use AddFieldAsXml) This makes life a lot easier later on in code, as the IDs will remain constant throughout your development lifecycle between environments.
With SharePoint 2010's Feature ...
Only top voted, non community-wiki answers of a minimum length are eligible
