O
O
Oscar Handsome2017-10-12 19:47:00
PHP
Oscar Handsome, 2017-10-12 19:47:00

UMI.CMS layout / integration / XSLT problems with the menu, is there anyone to help?

Hi all.
There is the following menu:
jSfa1bcVQH_O4Lpodgx39Q.pngHlifOLMrTfGfECTwAtiuyw.png
Code of this kind:

<!-- Header menu -->
    <xsl:template match="udata[@module = 'menu']" mode="info-pages-head">
        <header> 
            <div class="menu-bg"></div>
            <div class="container">
                <img src="{$template-resources}css/img/logo.png" class="logo" alt="LogoEridangroup"/>
                <nav class="menu">
                    <ul>
                        <xsl:apply-templates select="item" mode="info-pages-head" />
                    </ul>
                </nav>
                <xsl:apply-templates select="document('udata://banners/fastInsert/slider_block/')/udata/banner" mode="test-banner"/>
            </div>
        </header>
    </xsl:template>
    <xsl:template match="udata[@module = 'menu']/item" mode="info-pages-head">
        <li>
            <a href="{@link}">
                <xsl:value-of select="node()" />
            </a>
            <xsl:apply-templates select="items[item]" mode="info-pages-head"/>
        </li>
    </xsl:template>
    <xsl:template match="items" mode="info-pages-head">
        <ul class="sub-menu">
            <a><xsl:apply-templates select="item" mode="info-pages-head-sub"/></a>
        </ul>
    </xsl:template>
    <xsl:template match="item" mode="info-pages-head-sub">
        <li>
            <a href="{@link}">
                <xsl:value-of select="node()" />
            </a> 
        </li>
    </xsl:template>

Question:
Why does it fall off, then the last menu item "Contacts" appears? How to catch the error?
Why does the layout "go" at the first item in the submenu?
Didn't come up with anything brilliant. And I can’t debug, because menu item appears and disappears.
eu1TUuHORK2kYftHBnz1oQ.png
upd: added a photo.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Myasin, 2017-10-12
@dubr

The last point is "USGULI" which one? To begin with, it would be nice to figure out exactly how it disappears - in the sense of not looking at how it looks, but what happens in the resulting html. Maybe it is, but something else overlaps it, for example. Or there is a link, but the text is empty. If not, I would print out the number of nodes that should be rendered, like this:

<xsl:value-of select="count(item)" />
<ul> ...

Or where does it go missing. If the figure dances - smoke, what php gives there. If the number does not change, but the item still blinks ... then xs, apparently you will still have to read and comprehend this sheet of code))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question