Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft ® Official Course Developing a Publishing Site for Web Content Microsoft SharePoint 2013 SharePoint Practice.

Similar presentations


Presentation on theme: "Microsoft ® Official Course Developing a Publishing Site for Web Content Microsoft SharePoint 2013 SharePoint Practice."— Presentation transcript:

1 Microsoft ® Official Course Developing a Publishing Site for Web Content Microsoft SharePoint 2013 SharePoint Practice

2 Module Overview Programming with the Web Content Publishing API Developing Page Components for Web Content Publishing

3 Lesson 1: Programming with the Web Content Publishing API Introduction to Developing Publishing Solutions Getting Started with the Publishing API Working with Page Layouts Working with Publishing Pages Working with Navigation Settings

4 Introduction to Developing Publishing Solutions Requires activation of Publishing-related Features: PublishingSite (Site-scoped) PublishingWeb (Web-scoped) Provides access to Publishing site specific capabilities: Page Layouts and Publishing Pages Navigation Cross-Site Publishing Variations and Device Targeting Search Engine Optimization Image Renditions

5 Getting Started with the Publishing API Requires full-trust solution package deployment Highest level of customization potential Only available for On-Premises Farms Assembly \15\ISAPI\Microsoft.SharePoint.Publishing.dll Root Namespace Microsoft.SharePoint.Publishing

6 Working with Page Layouts Page Layouts are deployed using a Module element in a Solution Package Deployed to the Master Page Gallery New File element attributes: ReplaceContent: Overwrites contents if file exists Level: Publishes in Draft or Published mode New File properties: PublishingHidden: Hide from the SharePoint UI HtmlDesignAssociated: True or False whether to associate and synchronize the Page Layout.ASPX file with an HTML template

7 Working with Publishing Pages Publishing pages can be provisioned using a Module element, or programmatically using the SSOM/CSOM Provisioning a publishing page in code requires an instance of the PublishingWeb object: PublishingPage.AddPublishingPage( string name, PageLayout layout ) The PublishingPage class provides members for accessing publishing specific capabilities on an SPListItem object.

8 Working with Navigation Settings Two standard navigation providers: Structured (PortalProvider) Managed (TaxonomyProvider) Structured navigation settings: Namespace: Microsoft.SharePoint.Publishing.Navigation Class: PortalNavigation Managed navigation settings: Namespace: Microsoft.SharePoint.Publishing Class: WebNavigationSettings

9 Lesson 2: Developing Page Components for Web Content Publishing The Publishing Site Page Model Page Content Controls and Components Working with Field Controls Working with Web Parts Working with Client Web Parts Working with Delegate Controls Working with ScriptLink Custom Actions Demonstration: Deploying a ScriptLink Custom Action Using the JSLink Property with Display Templates

10 The Publishing Site Page Model Content

11 The Relationship between Master Pages and Page Layouts Master Page <asp:ContentPlaceHolder Id=“PlaceHolderPageTitle” runat=“Server”> // default content Page Layout <asp:Content ContentPlaceHolderId=“PlaceHolderPageTitle” runat=“Server”> // override content

12 The Relationship between Page Layouts and Pages Page Layout <asp:Content ContentPlaceHolderId=“PlaceHolderPageTitle” runat=“Server”> <PublishingWebControls:RichHtmlField FieldName=“PublishingPageContent” /> Page Content Type

13 Page Content Controls and Components

14 Working with Field Controls Page Field Controls bind to columns on the content type associated with the Page Layout Each page provides the content and values displayed by field controls Separate types of field controls for specific field types (Text, Choice, etc) <SharePointWebControls:TextField runat="server" FieldName="Title" />

15 Rendering Templates Field controls leverage rendering templates for display, and new/edit UI Rendering templates are hosted on User Controls (.ASCX) files deployed to the CONTROLTEMPLATES folder

16 Working with Web Parts Working with Web Parts utilizes a combination of controls: SPWebPartManager: manages web parts, connections and events on a page WebPartZone: provides a container to host web parts and provide a UI for users to manage web parts when editing a page WebPart: individual controls that can be added to a page.

17 Adding Web Parts to a Page Web Parts can be added to a page in a number of ways: SharePoint UI: Web Parts can be added by a user when editing a page through the UI Embedded: Web Part tags can be embedded in a page by a designer Element: Using the AllUsersWebPart element in a Feature Module Programmatically: By accessing the Web Part Manager on a page

18 Working with Client Web Parts New Web Part added to SharePoint 2013 to support the App model One of the few elements provisioned by an App that installs in the Host Web Utilizes an HTML IFrame control with a source link to a page located in a remote App site Can be added to a page layout or site page as any standard Web Part

19 Adding a Client Web Part to a Page Content element specifies the remote page to display in the Web Part Custom properties support as URL parameters <WebPartPages:ClientWebPart runat="server" Name="ClientWebPart" Title="Publishing Web Settings" DefaultWidth="350" DefaultHeight="900"> <Content Type="html“ Src="~appWebUrl/Pages/AppPart.aspx?{StandardTokens}"/>

20 Working with Delegate Controls Delegate controls provide placeholders for controls to be registered and loaded at runtime Delegate controls can host a single control, or multiple controls Each delegate control has a unique name that is used when registering a control

21 Working with ScriptLink Custom Actions Custom Actions allow custom commands to be added to SharePoint UI controls like the ribbon menu, or the List Edit Control Block (ECB) The ScriptLink control is included in SharePoint out-of-box master pages, and can be a target for a Custom Action. Allows dynamic insertion of JavaScript links or a script block to be inserted into a page.

22 Demonstration: Deploying a ScriptLink Custom Action In this demonstration, you will see an example of how to develop and deploy a ScriptLink custom action.

23 Demonstration: Deploying a Script Link Custom Action

24 Using the JSLink Property with Display Templates JSLink property introduced in SharePoint 2013 Utilizes a display template written in JavaScript to modify behavior and display Available on select objects including: Fields Views Content Types Forms Web Parts (Limited)

25 Lab: Customizing a SharePoint Publishing Site Exercise 1: Building a Custom Page Field Control Exercise 2: Building a Page Layout

26 Lab Scenario The Contoso Marketing team would like to author new articles related to product news and events. They have requested a custom page layout for authoring product articles that includes the related product code. When users author a product news article, they should be able to edit the product code. When the product code is displayed on the page, it should be hyperlinked to the product catalog details page.

27 Module Review and Takeaways Review Question(s)

28 Module Review and Takeaways


Download ppt "Microsoft ® Official Course Developing a Publishing Site for Web Content Microsoft SharePoint 2013 SharePoint Practice."

Similar presentations


Ads by Google