Skip to content

Commit

Permalink
UBO-380 Allow to disable generation of data-subtext attributes in myc… (
Browse files Browse the repository at this point in the history
#440)

* UBO-380 Allow to disable generation of data-subtext attributes in mycoreclass-options.xsl by setting UBO.ClassOptions.BootstrapSelect.subtext, default is true

* UBO-380 Added support for parameter 'omitSubtext' in mycoreclass-options.xsl
  • Loading branch information
Possommi authored Dec 5, 2024
1 parent 2ba37d6 commit cd4eefb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<option value="">
<xed:output i18n="search.select"/>
</option>
<xed:include uri="xslStyle:mycoreclass-options:classification:metadata:-1:children:partOf" />
<xed:include uri="xslStyle:mycoreclass-options?omitSubtext={$UBO.Editor.import-list.omitSubtext}:classification:metadata:-1:children:partOf" />
</select>
</div>
</xed:bind>
Expand Down Expand Up @@ -106,7 +106,7 @@
</label>
<select id="{generate-id()}" class="autocomplete {$xed-validation-marker} col-7 form-control custom-select">
<option value=""><xed:output i18n="search.select" /></option>
<xed:include uri="xslStyle:mycoreclass-options:classification:metadata:-1:children:ORIGIN" />
<xed:include uri="xslStyle:mycoreclass-options?omitSubtext={$UBO.Editor.import-list.omitSubtext}:classification:metadata:-1:children:ORIGIN" />
</select>
</div>
</xed:bind>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ MCR.EventHandler.MCRObject.100.Class=org.mycore.solr.index.MCRSolrIndexEventHand
######################################################################
UBO.Editor.PartOf.Enabled=false

# Enable/disable generating data-subtext attributes in selects in import-list.xed
UBO.Editor.import-list.omitSubtext=false

######################################################################
# #
# Legacy Search Fields #
Expand Down
7 changes: 4 additions & 3 deletions ubo-common/src/main/resources/xsl/mycoreclass-options.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<xsl:param name="CurrentLang" />
<xsl:param name="DefaultLang" />
<xsl:param name="omitSubtext" select="'false'"/>

<xsl:variable name="nbsp" select="'&#160;'" />
<xsl:variable name="arrow" select="'&#187;'" />
Expand All @@ -27,14 +28,14 @@
</xsl:variable>

<xsl:variable name="title">
<xsl:if test="$level &gt; 1">
<xsl:if test="$level &gt; 1 and not($omitSubtext = 'true')">
<xsl:value-of select="concat($parentTitle,$parentChildDelimiter)" />
</xsl:if>
<xsl:value-of select="$label" />
</xsl:variable>

<option value="{@ID}">
<xsl:if test="$level &gt; 1">
<xsl:if test="$level &gt; 1 and not($omitSubtext = 'true')">
<xsl:attribute name="data-subtext">
<xsl:value-of select="concat($nbsp,$nbsp,'in ',$parentTitle)" />
</xsl:attribute>
Expand Down Expand Up @@ -66,4 +67,4 @@
</xsl:choose>
</xsl:template>

</xsl:stylesheet>
</xsl:stylesheet>

0 comments on commit cd4eefb

Please sign in to comment.