Migration of the training research service Please note that this migration also requires a technical migration Manual for technical migration from version 2.6.2 to version 2.6.3
The "Show routes" service parameter has been modified. It is no longer a Boolean, but a drop-down list with 4 possible options:
none : do not display routesall : display all routesmatching_search_only : display only routes matching search criteriaall_with_highlight : display all routes, highlighting those that match the search criteriaIn your overloads, look for places where you use the parameter <xsl:param name="displaySubProgram" select="ametys:serviceParameter('displaySubProgram')"/> The value is no longer "true" or "false", but one of the 4 values listed above.
Route display In the search results, the logic for displaying routes has therefore evolved to take into account the 4 possible values:
none : routes are not available at XML .all : the courses are all available at XML , you can display them under the course.matching_search_only : only courses matching the search criteria are available at XML . You can display them below the course.all_with_highlight : all routes are available in the input XML , but those with the "highlight " attribute are those that meet the search criteria, so you can customize the display between those that meet the criteria and others.You have 3 additional XSL templates to manage the display of routes, which you can use or override as you wish:
Oops! Copy to clipboard failed. Open the code and copy it manually. <xsl:template name="hit-subprograms">
<xsl:param name="class">custom</xsl:param>
<xsl:if test="$displaySubProgram != 'none' and subprogram">
<!-- Parcours répondant aux critère de recherche -->
<xsl:if test="subprogram[not(@highlight) or @highlight = 'true']">
<ul class="{$class} subprogram">
<xsl:for-each select="subprogram[not(@highlight) or @highlight = 'true']">
<li>
<xsl:if test="@highlight = 'true'"><xsl:attribute name="class">highlight</xsl:attribute></xsl:if>
<xsl:call-template name="hit-subprogram" />
</li>
</xsl:for-each>
</ul>
</xsl:if>
<!-- Autres parcours -->
<xsl:call-template name="hit-subprograms-others">
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="hit-subprograms-others">
<xsl:param name="class">custom</xsl:param>
<xsl:if test="$displaySubProgram = 'all_with_highlight' and subprogram[@highlight = 'false']">
<div class="other-subprograms">
<a class="collapsed" href="#" onclick="$j(this).toggleClass('collapsed')">
<span>
<xsl:choose>
<xsl:when test="subprogram[@highlight = 'true']">
<i18n:text i18n:key="PLUGINS_ODFWEB_SERVICE_SEARCH_NOT_MATCHING_SUBPROGRAM_OTHERS" i18n:catalogue="plugin.odf-web"/>
</xsl:when>
<xsl:otherwise>
<i18n:text i18n:key="PLUGINS_ODFWEB_SERVICE_SEARCH_NOT_MATCHING_SUBPROGRAM_SEE" i18n:catalogue="plugin.odf-web"/>
</xsl:otherwise>
</xsl:choose>
</span>
</a>
<ul id="other-subprograms-{$uniqueId}-{position()}" class="{$class} subprogram others">
<xsl:for-each select="subprogram[@highlight = 'false']">
<li>
<xsl:call-template name="hit-subprogram" />
</li>
</xsl:for-each>
</ul>
</div>
</xsl:if>
</xsl:template>
<xsl:template name="hit-subprogram" >
<a>
<xsl:attribute name="href">
<xsl:call-template name="hit-href">
<xsl:with-param name="url" select="concat(../uri, '/', @path)"/>
</xsl:call-template>
</xsl:attribute>
<xsl:value-of select="@title"/>
</a>
</xsl:template>
<xsl:template name="hit-subprograms">
<xsl:param name="class">custom</xsl:param>
<xsl:if test="$displaySubProgram != 'none' and subprogram">
<!-- Parcours répondant aux critère de recherche -->
<xsl:if test="subprogram[not(@highlight) or @highlight = 'true']">
<ul class="{$class} subprogram">
<xsl:for-each select="subprogram[not(@highlight) or @highlight = 'true']">
<li>
<xsl:if test="@highlight = 'true'"><xsl:attribute name="class">highlight</xsl:attribute></xsl:if>
<xsl:call-template name="hit-subprogram" />
</li>
</xsl:for-each>
</ul>
</xsl:if>
<!-- Autres parcours -->
<xsl:call-template name="hit-subprograms-others">
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="hit-subprograms-others">
<xsl:param name="class">custom</xsl:param>
<xsl:if test="$displaySubProgram = 'all_with_highlight' and subprogram[@highlight = 'false']">
<div class="other-subprograms">
<a class="collapsed" href="#" onclick="$j(this).toggleClass('collapsed')">
<span>
<xsl:choose>
<xsl:when test="subprogram[@highlight = 'true']">
<i18n:text i18n:key="PLUGINS_ODFWEB_SERVICE_SEARCH_NOT_MATCHING_SUBPROGRAM_OTHERS" i18n:catalogue="plugin.odf-web"/>
</xsl:when>
<xsl:otherwise>
<i18n:text i18n:key="PLUGINS_ODFWEB_SERVICE_SEARCH_NOT_MATCHING_SUBPROGRAM_SEE" i18n:catalogue="plugin.odf-web"/>
</xsl:otherwise>
</xsl:choose>
</span>
</a>
<ul id="other-subprograms-{$uniqueId}-{position()}" class="{$class} subprogram others">
<xsl:for-each select="subprogram[@highlight = 'false']">
<li>
<xsl:call-template name="hit-subprogram" />
</li>
</xsl:for-each>
</ul>
</div>
</xsl:if>
</xsl:template>
<xsl:template name="hit-subprogram" >
<a>
<xsl:attribute name="href">
<xsl:call-template name="hit-href">
<xsl:with-param name="url" select="concat(../uri, '/', @path)"/>
</xsl:call-template>
</xsl:attribute>
<xsl:value-of select="@title"/>
</a>
</xsl:template>
Voir le code
<xsl:template name="hit-subprograms">
<xsl:param name="class">custom</xsl:param>
<xsl:if test="$displaySubProgram != 'none' and subprogram">
<!-- Parcours répondant aux critère de recherche -->
<xsl:if test="subprogram[not(@highlight) or @highlight = 'true']">
<ul class="{$class} subprogram">
<xsl:for-each select="subprogram[not(@highlight) or @highlight = 'true']">
<li>
<xsl:if test="@highlight = 'true'"><xsl:attribute name="class">highlight</xsl:attribute></xsl:if>
<xsl:call-template name="hit-subprogram" />
</li>
</xsl:for-each>
</ul>
</xsl:if>
<!-- Autres parcours -->
<xsl:call-template name="hit-subprograms-others">
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="hit-subprograms-others">
<xsl:param name="class">custom</xsl:param>
<xsl:if test="$displaySubProgram = 'all_with_highlight' and subprogram[@highlight = 'false']">
<div class="other-subprograms">
<a class="collapsed" href="#" onclick="$j(this).toggleClass('collapsed')">
<span>
<xsl:choose>
<xsl:when test="subprogram[@highlight = 'true']">
<i18n:text i18n:key="PLUGINS_ODFWEB_SERVICE_SEARCH_NOT_MATCHING_SUBPROGRAM_OTHERS" i18n:catalogue="plugin.odf-web"/>
</xsl:when>
<xsl:otherwise>
<i18n:text i18n:key="PLUGINS_ODFWEB_SERVICE_SEARCH_NOT_MATCHING_SUBPROGRAM_SEE" i18n:catalogue="plugin.odf-web"/>
</xsl:otherwise>
</xsl:choose>
</span>
</a>
<ul id="other-subprograms-{$uniqueId}-{position()}" class="{$class} subprogram others">
<xsl:for-each select="subprogram[@highlight = 'false']">
<li>
<xsl:call-template name="hit-subprogram" />
</li>
</xsl:for-each>
</ul>
</div>
</xsl:if>
</xsl:template>
<xsl:template name="hit-subprogram" >
<a>
<xsl:attribute name="href">
<xsl:call-template name="hit-href">
<xsl:with-param name="url" select="concat(../uri, '/', @path)"/>
</xsl:call-template>
</xsl:attribute>
<xsl:value-of select="@title"/>
</a>
</xsl:template>
Display example :
To display/hide "other" routes, click on the "View routes" link and add the following to your list CSS
Oops! Copy to clipboard failed. Open the code and copy it manually..other-subprograms a.collapsed + ul { display: none }
.other-subprograms > a > span:before {content: '« '}
.other-subprograms a.collapsed > span:before { content: '» '}
.other-subprograms a.collapsed + ul { display: none }
.other-subprograms > a > span:before {content: '« '}
.other-subprograms a.collapsed > span:before { content: '» '}
.other-subprograms a.collapsed + ul { display: none }
.other-subprograms > a > span:before {content: '« '}
.other-subprograms a.collapsed > span:before { content: '» '}