Skip to content

Commit

Permalink
Added README files
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Dammark committed Nov 23, 2014
1 parent 2d51013 commit 8d72cd1
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 3 deletions.
29 changes: 29 additions & 0 deletions ArcheType/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Archetype Helper

Helper file for rendering Archetype fieldsets:

## How to use it

1. Include this file in your main XSLT file:

```xslt
<xsl:include href="_ArcheType.xslt" />
```

2. Create templates as usual for the types of nodes that are selectable in the picker, e.g.:

```xslt
<xsl:template match="fieldsets[alias='textcontent']">
<!-- Code for textcontent -->
</xsl:template>

<xsl:template match="fieldsets[alias='mediacontent']">
<!-- Code for mediacontent -->
</xsl:template>
```

3. Apply templates in "multipicker" mode, to the picker property:

```xslt
<xsl:apply-templates select="myArchetypeProperty" mode="archetype" />
```
32 changes: 32 additions & 0 deletions MediaHelper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Media Helper

Helper file for rendering media from the media section:

## How to use it

1. Include this file in your main XSLT file:

```xslt
<xsl:include href="_MediaHelper.xslt" />
```

2. Apply templates in "media" mode, to the media picker property:

```xslt
<xsl:template match="myMediaProperty" mode=="media" />
```

### Properties

The helper takes 2 properties:
- cropset
- quality (default is 90)

If you're using the built-in Image Cropper, you can use the helper like this:

```xslt
<xsl:apply-templates select="myMediaProperty" mode="media">
<xsl:with-param name="cropset" select="'mycropsetname'" />
<xsl:with-param name="quality" select="85" />
</xsl:apply-templates>
```
3 changes: 0 additions & 3 deletions MediaHelper/_MediaHelper.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@

<xsl:template match="*" mode="media">
<xsl:param name="cropset" />
<xsl:param name="scale" select="true()" />
<xsl:param name="quality" select="'90'" />

<xsl:variable name="media" select="umb:GetMedia(., 1)" />

<xsl:apply-templates select="$media[@id and not(error)]">
<xsl:with-param name="cropset" select="$cropset" />
<xsl:with-param name="quality" select="$quality" />
<xsl:with-param name="scale" select="$scale" />
</xsl:apply-templates>
</xsl:template>

<xsl:template match="Image">
<xsl:param name="cropset" />
<xsl:param name="quality" />
<xsl:param name="scale" />
<xsl:variable name="data" select="umb:JsonToXml(umbracoFile)" />
<xsl:variable name="src" select="$data/src" />

Expand Down
25 changes: 25 additions & 0 deletions MultiNodeTreePicker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# MultiNodeTreePicker Helper

Helper file for rendering MultiNodeTreePickers(MNTP):

## How to use it

1. Include this file in your main XSLT file:

```xslt
<xsl:include href="_MultiNodePreePicker.xslt" />
```

2. Create templates as usual for the types of nodes that are selectable in the picker, e.g.:

```xslt
<xsl:template match="mydocument">
<!-- Code for mydocument -->
</xsl:template>
```

3. Apply templates in "mntp" mode, to the MNTP property:

```xslt
<xsl:template match="myMNTPProperty" mode="mntp" />
```

0 comments on commit 8d72cd1

Please sign in to comment.