Created
December 22, 2010 16:49
-
-
Save nickdunn/751748 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:include href="../symphony/master.xsl"/> | |
<xsl:include href="../symphony/field.xsl"/> | |
<!-- | |
<field id="1" type="input" required="yes" handle="title" position="sidebar"> | |
<label>Title</label> | |
<validation><![CDATA[regex]]></validation> | |
<config-name>value</config-name> | |
</field> | |
<entry id="1"> | |
<title handle="my-post">My Post</title> | |
<field>...</field> | |
</entry> | |
// build sidebar fields | |
<xsl:apply-templates select="section/fields/field[position='sidebar']" mode="entry-form"> | |
<xsl:param name="entry" select="/data/entry"/> | |
<xsl:param name="value" select="/data/entry/*[name()=name/@handle]"/> | |
</xsl:apply-templates> | |
--> | |
<!-- | |
Template: entry-table | |
Description: creates hyperlink from table to edit form | |
--> | |
<xsl:template match="field" mode="entry-table"> | |
<xsl:param name="entry"/> | |
<xsl:param name="value"/> | |
<a href="/symphony/publish/content/{$entry/@id}/edit/"> | |
<xsl:value-of select="value"/> | |
</a> | |
</xsl:template> | |
<!-- | |
Template: entry-form | |
Description: render form on entry edit/new forms | |
--> | |
<xsl:template match="field" mode="entry-form"> | |
<xsl:param name="entry"/> | |
<xsl:param name="value"/> | |
<div class="field"> | |
<input type="text" name="fields[{name/@handle}]"> | |
<xsl:if test="$entry"> | |
<xsl:attribute name="value"> | |
<xsl:value-of select="$data/value"/> | |
</xsl:attribute> | |
</xsl:if> | |
</input> | |
</div> | |
</xsl:template> | |
<!-- | |
Template: configuration | |
Description: when editing existing or adding field to new section | |
--> | |
<xsl:template match="field" mode="configuration"> | |
<xsl:param name="section"/> | |
<div class="field"> | |
<!-- re-usable System templates for: | |
- Show Column | |
- Regular Expression list | |
- Lists of directories in /workspace | |
- Name/Label | |
--> | |
</div> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment