Document types as child documents (classic asp includes)
First post / question.
Can child pages, or the content from them, specifically the generic properties one defines and then populates upon instantiation, be incorporated into a parent page dynamically, a la
The goal here is to create a container page and have 'n' number of child sections of a different document type used to build out the body section. As an example if I were building a resume template I'd want to use the contents of the child pages to build out the repeating sections for my job experience so in the content tree view it would look something like this:
- Resume page doc type (top level) with static content
-- job 1 (dynamic / injected )
-- job 2 (dynamic / injected )
-- job 3 (dynamic / injected )
more static content from Resume page doc type (footer etc...)
So that at runtime I can/want to use a XSLT macro to inject the information from each child page (job 1,2.3...) into the containing Resume page.
Just create an xslt macro, and use the $currentPage parameter to get to the subpages using xpath. Something like:
<!-- Loop the child pages -->
<xsl:for-each select="$currentPage/*[@isDoc]>
<!-- Write out the genereic property "MyProperty"-->
<h1><xsl:value-of select="MyProperty"/></h1>
<!-- To see the exact xml for the node, use this: -->
<!--<xsl:copy-of select="."/>-->
</xsl:for-each>
Hope this gets you started. There is also a lot to learn from the built in xslt templates that you can choose from when creating a new file.
If I use the <xsl:value-of select="data [@alias='Any Generic Property']"/> expression I don't get any data.
Looking at the cmscontentxml table in the DB I can see the format of the XML in the table so
I should be able to grab that from the current context and in fact when I test the xPath using an xPath parser it works.
Here is the XML format as stored in cmscontentxml table:
<cEngagement id="1121" parentID="1110" level="2" writerID="0" creatorID="0" nodeType="1118" template="1119" sortOrder="2" createDate="2010-10-08T12:00:21" updateDate="2010-10-08T13:33:06" nodeName="SpeakEZ" urlName="speakez" writerName="Administrator" creatorName="Administrator" path="-1,1110,1121" isDoc="">
<engagementTitle>SpeakEZ Systems (start up)</engagementTitle>
<client>Start up</client>
<dateStart>2009-04-01T00:00:00</dateStart>
<dateEnd>2009-08-01T00:00:00</dateEnd>
<technologies>
<![CDATA[jQuery
ASP.net 3.5
Windows Mobile 6/6.5
SQL Server 2005
Microsoft Exchange Server 2007]]>
</technologies>
<engagementDescription><![CDATA[The goal of this effort was to enable users to update their Outlook calendar using natural voice commands via their wireless handset.]]></engagementDescription>
</cEngagement>
Document types as child documents (classic asp includes)
First post / question.
Can child pages, or the content from them, specifically the generic properties one defines and then populates upon instantiation, be incorporated into a parent page dynamically, a la
The goal here is to create a container page and have 'n' number of child sections of a different document type used to build out the body section. As an example if I were building a resume template I'd want to use the contents of the child pages to build out the repeating sections for my job experience so in the content tree view it would look something like this:
- Resume page doc type (top level) with static content
-- job 1 (dynamic / injected )
-- job 2 (dynamic / injected )
-- job 3 (dynamic / injected )
more static content from Resume page doc type (footer etc...)
So that at runtime I can/want to use a XSLT macro to inject the information from each child page (job 1,2.3...) into the containing Resume page.
Any comments on this design?
Thanks
That is indeed possible.
Just create an xslt macro, and use the $currentPage parameter to get to the subpages using xpath. Something like:
Hope this gets you started. There is also a lot to learn from the built in xslt templates that you can choose from when creating a new file.
Thank you for your reply.
If I use a variation upon your example, shown below, I get all the information for the current context as it iterates the pages.
<xsl:template match="/">
<ul>
<xsl:for-each select="$currentPage/*[@isDoc]">
<h3>
<xsl:value-of select="@nodeName"/>
h3>
<xsl:value-of select="."/>
xsl:for-each>
ul>
xsl:template>
If I use the <xsl:value-of select="data [@alias='Any Generic Property']"/> expression I don't get any data.
Looking at the cmscontentxml table in the DB I can see the format of the XML in the table so
I should be able to grab that from the current context and in fact when I test the xPath using an xPath parser it works.
Here is the XML format as stored in cmscontentxml table:
Any suggestions as to where I'm in error?
You should not use the data[...] approach. You are using the new schema so just do as in my example:
That did the trick.
Many thanks!
is working on a reply...