MDL-66849 output: Remove custom menu title when not specified
[moodle.git] / lib / templates / custom_menu_item.mustache
CommitLineData
28cbff4a
MM
1{{!
2 This file is part of Moodle - http://moodle.org/
3
4 Moodle is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 Moodle is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16}}
17{{!
18 @template core/custom_menu_item
19
20 This template renders a node as part of a submenu.
21
22 Example context (json):
23 {
24 "divider": "",
25 "haschildren": "1",
26 "uniqid": "Unique string",
27 "text": "Moodle community",
28 "children": "[custom_menu_item object]",
29 "title": "Moodle community",
30 "url": "https://moodle.org"
31 }
32}}
f130c411
DW
33{{^divider}}
34{{#haschildren}}
3ec69c2e 35<li class="dropdown nav-item">
8056397b 36 <a class="dropdown-toggle nav-link" id="drop-down-{{uniqid}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#" {{#title}}title="{{{title}}}"{{/title}} aria-controls="drop-down-menu-{{uniqid}}">
000355f2 37 {{{text}}}
f130c411 38 </a>
805f078b 39 <div class="dropdown-menu" role="menu" id="drop-down-menu-{{uniqid}}" aria-labelledby="drop-down-{{uniqid}}">
f130c411
DW
40 {{#children}}
41 {{^divider}}
805f078b 42 <a class="dropdown-item" role="menuitem" href="{{{url}}}" {{#title}}title="{{{title}}}"{{/title}}>{{{text}}}</a>
f130c411
DW
43 {{/divider}}
44 {{#divider}}
191a1c7c 45 <div class="dropdown-divider" role="presentation"></div>
f130c411
DW
46 {{/divider}}
47 {{/children}}
48 </div>
3ec69c2e 49</li>
f130c411
DW
50{{/haschildren}}
51{{^haschildren}}
3ec69c2e 52<li class="nav-item">
000355f2 53 <a class="nav-item nav-link" href="{{{url}}}" {{#title}}title="{{{title}}}"{{/title}}>{{{text}}}</a>
3ec69c2e 54</li>
f130c411
DW
55{{/haschildren}}
56{{/divider}}