Last active
March 10, 2016 08:34
-
-
Save alexwilson/51cf21f6d7d1bd9a7395 to your computer and use it in GitHub Desktop.
How to use literal HTML in eZ Platform
This file contains 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
## Path can point wherever, this currently assumes that you're whacking everything in /ezpublish/ | |
## but really this should be in a bundle. | |
system: | |
some_siteaccess_name: | |
fieldtypes: | |
ezxml: | |
custom_tags: [{path: %kernel.root_dir%/Resources/views/fields/ezxml/fields.xsl}] |
This file contains 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" | |
xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/" | |
xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/" | |
xmlns:image="http://ez.no/namespaces/ezpublish3/image/" | |
exclude-result-prefixes="xhtml custom image"> | |
<xsl:output method="html" indent="yes" encoding="UTF-8"/> | |
<!-- Literal HTML --> | |
<xsl:template match="literal"> | |
<xsl:choose> | |
<xsl:when test="@class='html'"> | |
<xsl:value-of select="." disable-output-escaping="yes"/> | |
</xsl:when> | |
<xsl:otherwise> | |
<pre> | |
<xsl:copy-of select="@*"/> | |
<xsl:apply-templates/> | |
</pre> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment