menuadd
Used to add "Add new page" buttons to page for conveniently create new pages. If this link is clicked, it will show small popup on screen to enter details for new page.
Usage:
{% menuadd parent=menuitem %}
<a class="edy-cbtn edy-menu-menuadd " data-remote="true" href="/admin/pages/new?parent_id=1" title="Add new page">
<span>
<span class="edy-cbtn-content">
<span class="edy-cbtn-ico">
<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg">
<path d="M7 5V2H5v3H2v2h3v3h2V7h3V5H7z" fill="currentColor"/>
</svg>
</span>
<span>Add</span>
</span>
</span>
</a>
Extended example:
{% menuadd parent=menuitem layout_title="Product" label="Add product" title="Add product page" class="my-class" style="color:green;" %}
Available attributes
-
class
-
This tag automatically adds the "edy-menu-menuadd" class to the link element so design authors can customize this button. This attribute allows to add additional classes to the link element.
{% menuadd parent=menuitem class="my-class1 my-class2" %}
-
This tag automatically adds the "edy-menu-menuadd" class to the link element so design authors can customize this button. This attribute allows to add additional classes to the link element.
-
label
-
Allows to override default link text. Default values are: "Add" (when parent is root (front) page) and "Add new page" for other cases.
{% menuadd parent=menuitem label="Add product" %}
-
Allows to override default link text. Default values are: "Add" (when parent is root (front) page) and "Add new page" for other cases.
-
layout_title
-
Allows to give hint for page add dialog about desired layout name.
{% menuadd parent=page.menuitem label="Add product" layout_title="Product" %}
-
Allows to give hint for page add dialog about desired layout name.
-
parent
- The parent page menu item for new subpage. Menuitem object like object is expected (object must have page_id property). Defaults to site.root_item.
{% menuadd parent=menuitem %}
- The parent page menu item for new subpage. Menuitem object like object is expected (object must have page_id property). Defaults to site.root_item.
-
style
-
Allows to add style to the link element.
{% menuadd parent=menuitem style="color: red;" %}
-
Allows to add style to the link element.
-
title
-
Allows to override default link title attribute. Default values are: "Add new page" (when parent is root (front) page) and "Add new subpage" for other cases.
{% menuadd parent=menuitem title="Add product page" %}
-
Allows to override default link title attribute. Default values are: "Add new page" (when parent is root (front) page) and "Add new subpage" for other cases.