display data definition text inside of pages
I'm using a data definition to have two text areas on a page. Problem is, is that one of the areas is showing up and the other isn't. The "content" textarea shows up in the Default area (or left-column) in my template... while the "images" textarea isn't displaying (it needs to be in the right-column area in my template). My setup is below, ask if you have any questions. Thanks.
Data definition:
<system-data-structure>
<group identifier="item" label="Item" multiple="true">
<text wysiwyg="true" identifier="content" label="Content"/>
<text wysiwyg="true" identifier="images" label="Images"/>
</group>
</system-data-structure>
Template:
<div class="left-col">
<h1 id="page-title"><system-page-title/></h1>
<system-region name="DEFAULT"/>
</div>
<div class="right-col">
<system-region name="images"/>
</div>
Page Configuration:
Default: Block = empty, Format = stylesheets/Content
Images: Block = empty, Format = stylesheets/Images
Content Stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/>
<xsl:template match="system-data-structure">
<xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
<xsl:copy-of select="content/node()"/>
</xsl:template>
</xsl:stylesheet>
Images Stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/>
<xsl:template match="system-data-structure">
<xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
<xsl:copy-of select="images/node()"/>
</xsl:template>
</xsl:stylesheet>
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Eric L. Epps on 09 Dec, 2010 02:30 PM
Looks like, in the images stylesheet, you're matching on "image" instead of "item"
<xsl:apply-templates select="item"/> ... <xsl:template match="item">
2 Posted by Jeff on 09 Dec, 2010 05:34 PM
Good eye, though it still isn't working.
3 Posted by Eric L. Epps on 09 Dec, 2010 05:53 PM
That's what I get for responding before I've had my coffee. I didn't look at your page configuration. Data definitions are applied only to the DEFAULT region.
So you'll want to get rid of the "images" region and have your XSLT generate the
4 Posted by Jeff on 09 Dec, 2010 07:08 PM
That was it, thanks.
Jeff closed this discussion on 09 Dec, 2010 07:08 PM.