Download presentation
1
Adxstudio Portals Training
Page Templates
2
Page Templates Layout Specification
There are two choices for defining a Page Template: Rewrite (.aspx page) Web Template In order to add a new rewrite (.aspx) Page Template, we must add it to our web project A Template defines the layout and functionality of a page. The Web Page record defines the content.
3
Template Building Tools
ASP.NET Web Controls User Controls MVC Helpers MasterPortal Helper Classes Useful controls which allow rendering of content from the CRM. Common functionality is encapsulated in the OOB User controls found in Master Portal Wider range of capabilities than the ASP.NET web controls and easy to use. Can be use on an ASP.NET Template Allows for easier querying and data manipulation in code behind.
4
Creating a New Page Template
Creating a new page template is as simple as adding a new .aspx page in your web project, then adding the appropriate Page Template record in your CRM organization Best practice dictates that you inherit from one of the Master Portal master pages – or a page that inherits from one of said master pages (Default.master) Code-behind class should inherit from PortalPage class Import the Adxstudio.Xrm.Web.Mvc.Html namespace in the markup
5
CrmEntityDataSource Control
Acts as a data source that allows data-binding to a single record in the CRM
6
Property Control Used to display html data stored in CRM
Allows the text to be modified using front-side editing
7
Property Control Properties PropertyName DataSourceID EditType
html text HtmlEncode Editable DefaultText Literal
8
CrmSiteMapChildView Control
Renders links based on navigational hierarchy of the web pages in the site A ListView, but bound automatically to the child nodes of the current sitemap node
9
CrmMetadataDataSource Control
Supplies data-bound controls with read-only metadata from CRM
10
Comments Comments can be enabled for Web Pages, Blog Posts, and Ideas (coming soon: Events) Add the Comments control to your page template and enable comments for the page
11
Ratings Ratings can be enabled for Web Page, Blog Posts, Page Comments, Blog Post Comments (coming soon: Events and Forum Posts) Add the MultiRatingControl to the page template and enable ratings on the record to have ratings render
12
MVC Helpers Useful helpers that fill the same roles as many of the Web Controls, Service Context Extensions, and PortalPage convenience classes More convenient than the web controls in many cases Can be used in ASP.NET web forms pages
13
Render attributes as HTML
Attribute Helpers Displays the Attribute as a front-side editable, non editable, or literal value Many overloads allow for various options to be set Front Side-Editable Has convenience variations: Attribute AttributeLiteral HtmlAttribute TextAttribute Render attributes as HTML Draws from either the current node of the site map or from any specified entity
14
Display and use their attributes in the markup
Portal Helpers Access key records MVC equivalent of the PortalPage.cs convenience properties: Entity Website PortalUser Display and use their attributes in the markup
15
Returns URLs or renders links based on data in CRM
Portal Helpers Links, or URLS Allow you to render links to site-mappable entities EntityLink EntityUrl Or links based on a site marker SiteMarkerLink SiteMarkerUrl Returns URLs or renders links based on data in CRM
16
Site Setting Helpers Content based on Site Settings
Often used to make logical decisions (such as in if/else expressions or loops) or to change the style or behavior of a control, action, or markup Has type-cast variations: BooleanSetting DecimalSetting IntegerSetting RenderPartialFromSetting Setting Get the Values of Site Settings and act upon that information
17
Renders Content Snippets
Snippet Helpers Renders Content Snippets Similar to the Attribute Helpers, but for Content Snippets instead Has convenience variations: Snippet SnippetLiteral HtmlSnippet TextSnippet Front-side editable chunks of content drawn from named records in the CRM
18
Web Link Helpers For rendering Web Links from Web Link Sets WebLink
WebLinkListItem WebLinks WebLinksNavBar WebLinksDropdowns
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.