Skip to content

Commit

Permalink
Merge pull request #85 from ezsystems/nicalkun-fix-embed-link
Browse files Browse the repository at this point in the history
xhtml output : support for linkable embeds
  • Loading branch information
vidarl authored Oct 26, 2018
2 parents 2cedfa1 + ac2d8da commit 53fbc5e
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,33 @@
<xsl:if test="@id">
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
</xsl:if>
<xsl:value-of select="text()" disable-output-escaping="yes"/>
<xsl:choose>
<xsl:when test="@url">
<a>
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:choose>
<xsl:when test="@ezlegacytmp-embed-link-target">
<xsl:value-of select="@ezlegacytmp-embed-link-target"/>
</xsl:when>
<xsl:otherwise>_self</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:if test="@xhtml:ezlegacytmp-embed-link-title">
<xsl:attribute name="title">
<xsl:value-of select="@xhtml:ezlegacytmp-embed-link-title"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="@class"/>
<xsl:value-of select="text()" disable-output-escaping="yes"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="text()" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<section
xmlns:image="http://ez.no/namespaces/ezpublish3/image/"
xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/"
xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/">
<!-- Note, this is not plain ezxmltext. This is output after Converter\EzLinkToHtml5 and Converter\EmbedToHtml5 has processed it-->
<paragraph>kake </paragraph>
<embed view="embed" size="medium" object_id="126" custom:offset="0" custom:limit="5" ezlegacytmp-embed-link-title="custom title" ezlegacytmp-embed-link-id="customID" ezlegacytmp-embed-link-url="http://ez.no" url="http://ez.no">
<![CDATA[
<!-- START ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Resources/views/default/content/embed_image.html.twig (EzPublishCoreBundle:default:content/embed_image.html.twig) -->
<figure class="ezimage-field">
<img src="http://localhost/var/ezdemo_site/storage/images/_aliases/medium/media/images/ez/775-1-eng-GB/ez.gif" alt="my alt text" height="67 " width="200 " />
</figure>
<!-- STOP ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Resources/views/default/content/embed_image.html.twig (EzPublishCoreBundle:default:content/embed_image.html.twig) -->
]]>
</embed>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<section xmlns="http://ez.no/namespaces/ezpublish5/xhtml5">
<p>kake </p>
<div>
<a href="http://ez.no" target="_self">
<figure class="ezimage-field">
<img alt="my alt text" height="67 " src="http://localhost/var/ezdemo_site/storage/images/_aliases/medium/media/images/ez/775-1-eng-GB/ez.gif" width="200 "/>
</figure>
</a>
</div>
</section>

0 comments on commit 53fbc5e

Please sign in to comment.