Renrenzhan CMS navigation menu and sub-column labels and calling methods

menus Get the list of navigation menus

Get a list of background navigation menu data

{rrz:menus type="top" row='8'}
    //html内容
{/rrz:menus}

Common properties:

parameter name

Types of

Defaults

must

illustrate

id

int/string

0

Yes

Navigation id (invalid when type is equal to top)

type

string

top

Yes

type of data

limit

string

0

Yes

List data volume

item

string

item

no

loop body variable name

key

string

key

no

The current loop is the number of data (starting from 0)

empty

string/html

empty string

no

What to output when there is no data

  • limit=”5” means to get the first 5 pieces of data
  • limit=”0,5” means to get 5 pieces of data backward from the 0th
  • limit=”1,5” means to get 5 pieces of data backward from the first one
  • New row attribute row=”5” is equivalent to limit=”0,5”

Legal values ​​for type:

value

illustrate

code

url

Navigation address

​{$item.url}​

title

navigation title

​{$item.title}​

en_title

Navigation English title

​{$item.en_title}​

target

page jump method

​{$item.target}​

class

Current style (when equal to on, the current page is the navigation page)

​{$item.class?'on':''}​

Common properties of $item:

value

illustrate

code

url

Navigation address

​{$item.url}​

title

navigation title

​{$item.title}​

en_title

Navigation English title

​{$item.en_title}​

target

page jump method

​{$item.target}​

class

Current style (when equal to on, the current page is the navigation page)

​{$item.class?'on':''}​

sons Navigate or sort a subset of fetches

  • Get a subset of navigation menus or article sections, product categories
  • If the navigation menu has no subordinates, take the subordinates of its associated article section or product category
{rrz:menus type="top" row='8'}
    {rrz:sons row='10'}
    {if $sons.ishas}<!--判断是否有子集-->
    {foreach $sons.list as $son}<!--循环处理子集数据-->
    <!--htmln内容-->
    {/foreach}
    {/if}
    {/rrz:sons}
{/rrz:menus}

Common properties of $sons:

value

illustrate

code

ishas

Is there a subordinate

​$sons.ishas​

list

Subset list

​$sons.list​

  • list Dataset content reference label cats or nodes

HTML example:

<ul>
    {rrz:menus type="top" row='8'}
    <li class="{$item.class?'on':''}">
        <a href="{$item.url}" target="{$item.target}" >{$item.title}</a>
        {rrz:sons row='10'}
        {if $sons.ishas}
        <div class="sub">
            {foreach $sons.list as $son}
            <a href="{$son.url}" target="{$item.target}">{$son.title}</a>
            {/foreach}
        </div>
        {/if}
        {/rrz:sons}
    </li>
    {/rrz:menus}
</ul>
{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324084929&siteId=291194637