H
H
Heretic Man2020-03-04 13:34:41
XSL & XSLT
Heretic Man, 2020-03-04 13:34:41

How to display news feed except for certain news in UMI?

Inside the news, I'm trying to display a list of news in the slider:

<!-- Слайдер новостей -->
<xsl:apply-templates select="document('udata://news/lastlist/(novosti)')" mode="right-column-news" />


Here is the output:
<xsl:stylesheet	version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:umi="http://www.umi-cms.ru/TR/umi"
  xmlns:xlink="http://www.w3.org/TR/xlink">

  <xsl:template match="udata" mode="right-column-news" />

  <xsl:template match="udata[items]" mode="right-column-news">
    <xsl:variable name="category-name" select="document(concat('upage://', category_id))/udata/page/name" />

    <section class="newsblock">
      <div class="block_title">Новости</div>

      <div class="news_slider">
        <xsl:apply-templates select="items/item" mode="right-column-news" />
      </div>
    </section>
  </xsl:template>

  <xsl:template match="item" mode="right-column-news">
    <xsl:variable name="item-info" select="document(@xlink:href)" />
    <xsl:variable name="title" select="." />
        <div class="news_item">
            <a href="{@link}" class="inner">
    		    <div class="thumb">
    		        <img src="{$item-info//property[@name = 'anons_pic']/value}" alt="{$title}" />
    		    </div>
    			<div class="name">
    			    <xsl:value-of select="$title" />
    			</div>
      	</a>
        </div>
  </xsl:template>
</xsl:stylesheet>


But it is necessary that there is no current news in this slider.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2020-11-20
@heretic_man

You can use not() , I don’t remember if it’s in the item id, for example like this:

....
<div class="news_slider">
    <xsl:apply-templates select="items/item[not(@id=$current-page-id)]" mode="right-column-news" />
</div>
....

All will remain except the current

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question