D
D
Dmitry Gorbach2014-07-31 11:46:09
XSL & XSLT
Dmitry Gorbach, 2014-07-31 11:46:09

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>

Can you tell me how to display this title for the menu now?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
UmiHelp, 2014-08-07
@UmiHelp

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>

menu 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 question

Ask a Question

731 491 924 answers to any question