<?
xml
version
=
"1.0"
?>
<
configuration
>
<
system.web
>
<
siteMap
enabled
=
"true"
defaultProvider
=
"Crm"
>
<
providers
>
<
clear
/>
<
add
name
=
"Crm"
type
=
"Microsoft.Xrm.Portal.Web.CrmSiteMapProvider, Microsoft.Xrm.Portal"
securityTrimmingEnabled
=
"true"
/>
</
providers
>
</
siteMap
>
<
system.web
>
<
configuration
>
<%$ CrmSiteMap: SiteMarker=siteMarker, Return=return, Eval=eval, Format=format, Portal=portal%>
<%$ CrmSiteMap: siteMarker, return, eval, format, portal%>
The first name value pair (SiteMarker) is the value of Name attribute (adx_name) of Site Marker entity (adx_sitemarker) contained in portalbase solution.
One instance of CrmSiteMapNode will be created for the rest of expression evaluation.
CrmSiteMapNode contains four more extra properties than base ASP.NET SiteMapNode object: Entity, LastModified, RewriteUrl and StatusCode. The entity will be the Web Page (adx_webpage) entity instance related to the Site Marker entity (adx_sitemarker) with the name specified.
The Web Page (adx_webpage) entity will be retrieved from CRM first, and the Partial Url (adx_partialurl) attribute value will be used to find CrmSiteMapNode within sitemap. If special value “Current” is specified, the current web page path will be used to find CrmSiteMapNode within sitemap.
CrmSiteMapProvider use Site Marker entity (adx_sitemarker) contained in portalbase solution as persistent store. SiteMap is defined as a view of Site Marker entity for the specified web site. If the partial url/web page path from the previous description is found in this list of Site Marker entities. A corresponding CrmSiteMapNode will be created otherwiset of expression evaluation.
CrmSiteMapNode contains four more extra properties than base ASP.NET SiteMapNode object: Entity, LastModified, RewriteUrl and StatusCode. The entity will be the Web Page (adx_webpage) entity instance related to the Site Marker entity (adx_sitemarker) with the name specified.
The Web Page (adx_webpage) entity will be retrieved from CRM first, and the Partial Url (adx_partialurl) attribute value will be used to find CrmSiteMapNode within sitemap. If special value “Current” is specified, the current web page path will be used one CrmSiteMapNode instance with “Page Not Found” Site Marker will be created. If “Page Not Found” Site Marker does not exist in CRM, null will be returned.
The second name value pair (Return) can be set to either “Entity” or “Url“, if it is not specified the value of Eval and Format will determine the expression value, if any other value is specified an instance of CrmSiteMapNode will be returned.
If it is set to “Entity”, the value of the expression will be the Web Page (adx_webpage) entity instance related to the Site Marker entity (adx_sitemarker) with the name specified for the first name value pair.
If it is set to “Url”, the value of the expression will be the Partial Url (adx_partialurl) attribute value of the Web Page (adx_webpage) entity instance related to the Site Marker entity (adx_sitemarker) with the name specified for the first name value pair.
If we have the following web page created within CRM (Name=”View Scheduled Services” Partial Url=”view-scheduled-services”)
<
asp:Literal
ID
=
"Literal1"
runat
=
"server"
Text="<%$ CrmSiteMap:
SiteMarker
=
View
Scheduled Services,
Return
=
Entity
%>" />
<
asp:Literal
ID
=
"Literal1"
runat
=
"server"
Text="<%$ CrmSiteMap:
SiteMarker
=
View
Scheduled Services,
Return
=
Url
%>" />
The third and fourth name value pair (Eval & Format) will only be taken into consideration when second name value pair (Return) is not specified. The value then will be passed as parameters to System.Web.UI.DataBinder.Eval(CrmSiteMapNode, eval, format) and the value is substituted for the expression syntax when the second name value pair is not specified.
The following expression will product “Partial Url is: /view-scheduled-services”
<
asp:Literal
ID
=
"Literal1"
runat
=
"server"
Text="<%$ CrmSiteMap:
SiteMarker
=
View
Scheduled Services,
Eval
=
Url
,
Format
=
Partial
Url is {0}%>" />