I am working more on the couchcms demo site and had a thought that it would be good to be able to automatically add clonable pages to the menu
I have the index.php as a nested page and created a page.php as a clonable to create pages
I found coding from a post looking to do the same and got a checkbox added to page.php which adds the checkbox on the admin panel when creating or editing a existing clonable page. I have a snippet called menu.html
My clonable page.php coding is below that adds the checkbox to the admin panel when creating a new page or editing a existing page
My menu html snippet coding is below
The coding I found by KK is: viewtopic.php?f=4&t=9885#p22663
When I did the coding below in menu.html, no menu was displayed
I was bit unsure how to amend the menu.html snippet to include both nested page in the menu as well as the clonable page using the checkbox field I added in
I have the index.php as a nested page and created a page.php as a clonable to create pages
I found coding from a post looking to do the same and got a checkbox added to page.php which adds the checkbox on the admin panel when creating or editing a existing clonable page. I have a snippet called menu.html
My clonable page.php coding is below that adds the checkbox to the admin panel when creating a new page or editing a existing page
- Code: Select all
<cms:editable name='my_show_in_menu' label='Show in menu' desc='tick if this page appears in the menu' opt_values='Yes=1' type='checkbox' order='200'
/>
My menu html snippet coding is below
- Code: Select all
<ul class="navbar-nav ml-auto">
<cms:nested_pages masterpage='index.php'>
<li class="nav-item">
<a class="nav-link" href="<cms:show k_nestedpage_link />"><cms:show k_nestedpage_title /></a>
</li>
</cms:nested_pages>
</ul>
The coding I found by KK is: viewtopic.php?f=4&t=9885#p22663
When I did the coding below in menu.html, no menu was displayed
- Code: Select all
<cms:if k_element_start ><li>
<a href="<cms:show k_menu_link />"><cms:show k_menu_title /></a>
<cms:if k_is_pointer && (k_nestedpage_name='first-page') >
<ul>
<cms:pages masterpage="<cms:show k_nestedpage_name />.php" custom_field="my_show_in_menu=1">
<li><a href="<cms:show k_page_link />"><cms:show k_page_name /></a></li>
</cms:pages>
</ul>
</cms:if>
</cms:if>
I was bit unsure how to amend the menu.html snippet to include both nested page in the menu as well as the clonable page using the checkbox field I added in