Answer the question
In order to leave comments, you need to log in
UMI CMS Added a new data type, how to display it now?
Good afternoon.
In the admin panel, UMI has added one more data type for the menu, "title" - the identifier "menu_title".
now I need to display it in the menu module XSLT template. here is the template.
<xsl:template match="udata[@module = 'menu' and @method = 'draw']|items" mode="footer_menu">
<p>@menu-title</p>
<ul umi:element-id="0" umi:module="menu" umi:region="list" umi:sortable="sortable" umi:add-method="popup">
<xsl:apply-templates select="item" mode="footer_menu" />
</ul>
</xsl:template>
<xsl:template match="item" mode="footer_menu">
<li>
<a href="{@link}" umi:element-id="{@id}" umi:region="row" umi:field-name="name" umi:empty="&empty-section-name;" umi:delete="delete">
<xsl:value-of select="." />
</a>
</li>
</xsl:template>
Answer the question
In order to leave comments, you need to log in
unfortunately, when transferring this module to umiSoft, we did not provide for displaying the menu id and additional fields.
It was discussed here umihelp.ru/forum/index.php/topic,1815.msg7795.html... and the solution is there. But it edits system files, which will be overwritten when umi.cms is updated.
There is another way.
We pass the value of this field when calling the macro. Something like this:
When calling a macro, we pass the name of the menu
<xsl:apply-templates select="document('udata://menu/draw/613')/udata" >
<xsl:with-param name="menu_name" select="document('uobject://613.menu_title')//value" />
</xsl:apply-templates>
<xsl:template match="udata[@module = 'menu' and @method = 'draw']|items" mode="footer_menu">
<xsl:param name="menu_name" />
<p><xsl:value-of select="$menu_name" /></p>
<ul umi:element-id="0" umi:module="menu" umi:region="list" umi:sortable="sortable" umi:add-method="popup">
<xsl:apply-templates select="item" mode="footer_menu" />
</ul>
</xsl:template>
<xsl:template match="item" mode="footer_menu">
<li>
<a href="{@link}" umi:element-id="{@id}" umi:region="row" umi:field-name="name" umi:empty="&empty-section-name;" umi:delete="delete">
<xsl:value-of select="." />
</a>
</li>
</xsl:template>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question