Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The answer to your first question depends on whether you mean <strong>application pages</strong> or <strong>content pages</strong>. They each have their advantages: application pages are good in that they can run custom server-side code, and content pages are nice because (for example) they can be customized by users, but by default are restricted in what kind of code can be run.</p> <p>For a pretty good discussion on the differences between the two types in capabilities and restrictions, check out the Windows SharePoint Services SDK and look at the topics called "<a href="http://msdn.microsoft.com/en-us/library/aa979604.aspx" rel="noreferrer">Application _layouts page type</a>" and "<a href="http://msdn.microsoft.com/en-us/library/aa979501.aspx" rel="noreferrer">Content page type</a>."</p> <p>As for stapling, it's pretty easy and more flexible than adding new features to a site definition's onet.xml file. This <a href="http://www.sharepointnutsandbolts.com/2007/05/feature-stapling.html" rel="noreferrer">article</a> seems a pretty good overview of the alternatives. You might want to make a copy of the blank site definition, rename it, and then use that one in your work, though.</p> <p><strong>Features with content pages</strong></p> <p>You'll need three types of things for this:</p> <ol> <li>A feature.xml file -- just the boilerplate stuff that refers to the element manifest.</li> <li>A page template -- this could be the entire aspx page itself, or it could be (for example) a shell of a web part page with <code>WebPartZones</code> defined but no actual web parts (yet).</li> <li>The element manifest file which refers to your page templates and defines any web parts that should be provisioned as part of activation of your feature.</li> </ol> <p>Your feature's folder structure would look something like this:</p> <pre><code>12 +-- TEMPLATES +-- FEATURES +-- YourFeature +-- PageTemplates | +-- Page.aspx (simple aspx page) | +-- WebPartPage.aspx (still simple, but with WebPartZones) +-- feature.xml +-- elements.xml </code></pre> <p><strong>Feature.xml:</strong></p> <pre><code>&lt;Feature Id="CFF117BC-9685-4a7b-88D0-523D9DAD21F0" Title="Custom Pages Feature" Scope="Web" xmlns="http://schemas.microsoft.com/sharepoint/"&gt; &lt;ElementManifests&gt; &lt;ElementManifest Location="elements.xml"/&gt; &lt;/ElementManifests&gt; &lt;/Feature&gt; </code></pre> <p><strong>Elements.xml</strong></p> <pre><code>&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt; &lt;Module Path="PageTemplates" Url="Pages" &gt; &lt;File Url="Page.aspx" Type="Ghostable" /&gt; &lt;File Url="WebPartPage.aspx" Name="WebPartPage.aspx" Type="Ghostable" &gt; &lt;AllUsersWebPart WebPartZoneID="Left" WebPartOrder="0"&gt; &lt;![CDATA[ &lt;WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" xmlns:cewp="http://schemas.microsoft.com/WebPart/v2/ContentEditor"&gt; &lt;Assembly&gt;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&lt;/Assembly&gt; &lt;TypeName&gt;Microsoft.SharePoint.WebPartPages.ContentEditorWebPart&lt;/TypeName&gt; &lt;Title&gt;Some content that you want to provision with the feature&lt;/Title&gt; &lt;FrameType&gt;TitleBarOnly&lt;/FrameType&gt; &lt;cewp:Content&gt; Hello world. &lt;/cewp:Content&gt; &lt;/WebPart&gt; ]]&gt; &lt;/AllUsersWebPart&gt; &lt;/File&gt; &lt;/Module&gt; &lt;/Elements&gt; </code></pre> <p><strong>Page.aspx</strong></p> <pre><code>&lt;%@ Page MasterPageFile="~masterurl/default.master" meta:progid="SharePoint.WebPartPage.Document" %&gt; &lt;asp:Content runat="server" ContentPlaceHolderID="PlaceHolderMain"&gt; Hello World &lt;/asp:Content&gt; </code></pre> <p><strong>WebPartPage.aspx</strong></p> <pre><code>&lt;%@ Page Language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" %&gt; &lt;%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt; &lt;asp:Content ID="main" runat="server" ContentPlaceHolderID="PlaceHolderMain" &gt; &lt;table width="100%"&gt; &lt;tr&gt; &lt;td valign="top" style="width:50%"&gt; &lt;WebPartPages:WebPartZone ID="Left" runat="server" FrameType="TitleBarOnly" Title="Left Web Part Zone" /&gt; &lt;/td&gt; &lt;td valign="top" style="width:50%"&gt; &lt;WebPartPages:WebPartZone ID="Right" runat="server" FrameType="TitleBarOnly" Title="Right Web Part Zone" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/asp:Content&gt; </code></pre> <p>If you configure your feature in that way, you should be able to deploy site content pages within that structure.</p> <p>Also, I highly recommend Ted Pattison's <a href="http://rads.stackoverflow.com/amzn/click/0735623201" rel="noreferrer">Inside Windows SharePoint Services</a> book. It covers this topic in much detail, including the important security aspects of site content pages. It's easily worth the purchase price.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload