Commit a0bc5479 authored by WalkingDexter's avatar WalkingDexter Committed by atymchuk

Issue #3048969: Add image title and caption to XSL

parent e97554a1
...@@ -91,6 +91,8 @@ class SimplesitemapController extends ControllerBase { ...@@ -91,6 +91,8 @@ class SimplesitemapController extends ControllerBase {
'[priority]' => $this->t('Priority'), '[priority]' => $this->t('Priority'),
'[translation-set]' => $this->t('Translation set'), '[translation-set]' => $this->t('Translation set'),
'[images]' => $this->t('Images'), '[images]' => $this->t('Images'),
'[image-title]' => $this->t('Title'),
'[image-caption]' => $this->t('Caption'),
'[jquery]' => base_path() . 'core/assets/vendor/jquery/jquery.min.js', '[jquery]' => base_path() . 'core/assets/vendor/jquery/jquery.min.js',
'[jquery-tablesorter]' => base_path() . $module_path . '/xsl/jquery.tablesorter.min.js', '[jquery-tablesorter]' => base_path() . $module_path . '/xsl/jquery.tablesorter.min.js',
'[parser-date-iso8601]' => base_path() . $module_path . '/xsl/parser-date-iso8601.min.js', '[parser-date-iso8601]' => base_path() . $module_path . '/xsl/parser-date-iso8601.min.js',
......
...@@ -133,9 +133,9 @@ ...@@ -133,9 +133,9 @@
<xsl:if test="/sitemap:urlset/sitemap:url/xhtml:link"> <xsl:if test="/sitemap:urlset/sitemap:url/xhtml:link">
<td> <td>
<xsl:if test="xhtml:link"> <xsl:if test="xhtml:link">
<dl class="translation-set"> <ul class="translation-set">
<xsl:apply-templates select="xhtml:link"/> <xsl:apply-templates select="xhtml:link"/>
</dl> </ul>
</xsl:if> </xsl:if>
</td> </td>
</xsl:if> </xsl:if>
...@@ -154,20 +154,17 @@ ...@@ -154,20 +154,17 @@
<!-- xhtml:link template --> <!-- xhtml:link template -->
<xsl:template match="xhtml:link"> <xsl:template match="xhtml:link">
<xsl:variable name="url_language">
<xsl:value-of select="@hreflang"/>
</xsl:variable>
<xsl:variable name="url_location"> <xsl:variable name="url_location">
<xsl:value-of select="@href"/> <xsl:value-of select="@href"/>
</xsl:variable> </xsl:variable>
<dt> <li>
<xsl:value-of select="$url_language"/> <span>
</dt> <xsl:value-of select="@hreflang"/>
<dd> </span>
<a href="{$url_location}"> <a href="{$url_location}">
<xsl:value-of select="$url_location"/> <xsl:value-of select="$url_location"/>
</a> </a>
</dd> </li>
</xsl:template> </xsl:template>
<!-- image:image template --> <!-- image:image template -->
...@@ -179,6 +176,20 @@ ...@@ -179,6 +176,20 @@
<a href="{$image_location}"> <a href="{$image_location}">
<xsl:value-of select="$image_location"/> <xsl:value-of select="$image_location"/>
</a> </a>
<!-- Show this element only if image:caption element is present -->
<xsl:if test="image:caption">
<div>
<span>[image-caption]</span>
<xsl:value-of select="image:caption"/>
</div>
</xsl:if>
<!-- Show this element only if image:title element is present -->
<xsl:if test="image:title">
<div>
<span>[image-title]</span>
<xsl:value-of select="image:title"/>
</div>
</xsl:if>
</li> </li>
</xsl:template> </xsl:template>
......
...@@ -64,29 +64,28 @@ table.sitemap thead tr .tablesorter-headerDesc .tablesorter-header-inner:after { ...@@ -64,29 +64,28 @@ table.sitemap thead tr .tablesorter-headerDesc .tablesorter-header-inner:after {
right: 0; right: 0;
} }
table.sitemap tbody tr dl.translation-set { table.sitemap tbody tr ul {
list-style: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
table.sitemap tbody tr dl.translation-set dt { table.sitemap tbody tr ul li:not(:first-of-type) {
text-transform: uppercase; margin-top: 5px;
float: left;
padding: 0;
margin: 0 5px 0 0;
} }
table.sitemap tbody tr dl.translation-set dt:after { table.sitemap tbody tr ul li span {
margin-right: 5px;
}
table.sitemap tbody tr ul li span:after {
content: ":"; content: ":";
} }
table.sitemap tbody tr dl.translation-set dd { table.sitemap tbody tr ul.translation-set li span {
padding: 0; text-transform: uppercase;
margin: 0;
} }
table.sitemap tbody tr ul.images { table.sitemap tbody tr ul.images li span {
list-style: none; font-style: italic;
padding: 0;
margin: 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment