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 {
'[priority]' => $this->t('Priority'),
'[translation-set]' => $this->t('Translation set'),
'[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-tablesorter]' => base_path() . $module_path . '/xsl/jquery.tablesorter.min.js',
'[parser-date-iso8601]' => base_path() . $module_path . '/xsl/parser-date-iso8601.min.js',
......
......@@ -133,9 +133,9 @@
<xsl:if test="/sitemap:urlset/sitemap:url/xhtml:link">
<td>
<xsl:if test="xhtml:link">
<dl class="translation-set">
<ul class="translation-set">
<xsl:apply-templates select="xhtml:link"/>
</dl>
</ul>
</xsl:if>
</td>
</xsl:if>
......@@ -154,20 +154,17 @@
<!-- xhtml:link template -->
<xsl:template match="xhtml:link">
<xsl:variable name="url_language">
<xsl:value-of select="@hreflang"/>
</xsl:variable>
<xsl:variable name="url_location">
<xsl:value-of select="@href"/>
</xsl:variable>
<dt>
<xsl:value-of select="$url_language"/>
</dt>
<dd>
<li>
<span>
<xsl:value-of select="@hreflang"/>
</span>
<a href="{$url_location}">
<xsl:value-of select="$url_location"/>
</a>
</dd>
</li>
</xsl:template>
<!-- image:image template -->
......@@ -179,6 +176,20 @@
<a href="{$image_location}">
<xsl:value-of select="$image_location"/>
</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>
</xsl:template>
......
......@@ -64,29 +64,28 @@ table.sitemap thead tr .tablesorter-headerDesc .tablesorter-header-inner:after {
right: 0;
}
table.sitemap tbody tr dl.translation-set {
table.sitemap tbody tr ul {
list-style: none;
padding: 0;
margin: 0;
}
table.sitemap tbody tr dl.translation-set dt {
text-transform: uppercase;
float: left;
padding: 0;
margin: 0 5px 0 0;
table.sitemap tbody tr ul li:not(:first-of-type) {
margin-top: 5px;
}
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: ":";
}
table.sitemap tbody tr dl.translation-set dd {
padding: 0;
margin: 0;
table.sitemap tbody tr ul.translation-set li span {
text-transform: uppercase;
}
table.sitemap tbody tr ul.images {
list-style: none;
padding: 0;
margin: 0;
table.sitemap tbody tr ul.images li span {
font-style: italic;
}
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