I have content that I've structured as follows in the content section in umbraco:
Items under the content node that have a folder icon are Content Pages. A content page can have another content page as a child or a content section which are the items with doc with image icon.
(source: flickr.com)I have a settings section that I've structured as follows:
开发者_如何学编程Each SectionDocumentType has a limited number of available templates the user can select
(source: flickr.com)What I'd like to do is to render Sections as rows of data in a content page while ignoring child content pages.
I'd like each section "row" to display template and all.
I'm new to XSLT so I'm wondering how could I do this?
Thanks for your help!
I figured this out.
Here is the xslt:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon"
xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes"
xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath"
xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions"
xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings"
xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:for-each select="$currentPage/child::*[@isDoc][@nodeType != 1230]">
<xsl:value-of select="umbraco.library:RenderTemplate(@id,@template)" disable-output-escaping="yes"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Also I had to add this line to my content section <umbraco:DisableRequestValidation runat="server"/>
in my content section templates.
Here is how you use it in your page template.
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
**<umbraco:DisableRequestValidation runat="server"/>**
**YOUR HTML GOES HERE**
</asp:Content>
精彩评论