Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Anyone available to help couchify this menu code? It needs to be this way for the theme to function.

Thanks!

:)

Code: Select all
<nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id="cbp-spmenu-s1">
   <li><a href="index.php">Home</a></li>
   <li class="dropdown">
      <a href="#" data-toggle="dropdown">About<span class="caret"></span></a>
      <ul class="dropdown-menu">
         <li><a href="about.php">Staff</a></li>
         <li><a href="about.php">History</a></li>
      </ul>
   </li>
   <li><a href="services.php">Services</a></li>
   <li><a href="gallery.php">Gallery</a></li>
   <li><a href="blog.php">Blog</a></li>
   <li><a href="contact.php">Contact</a></li>
</nav>
I assume, you are using here Nested Pages to generate menu.
Also you need to point manually every page to the template of your preference in Advanced Menu. Parent pages can be left as it is (untouched).
Try this:
Code: Select all
<cms:nested_pages masterpage='Your-Nested-Pages-Template.php' 
              extended_info='1' >
   <cms:if k_level_start >
      <cms:if k_level='0'>
         <nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id="cbp-spmenu-s1">
      <cms:else />
         <ul class="dropdown-menu">
      </cms:if>
   </cms:if>
   <cms:if k_element_start && k_immediate_children!='0' >
      <li class="dropdown"><a href="#" data-toggle="dropdown"><cms:show k_nestedpage_title /><span class="caret"></span></a>
    <cms:else />
      <li><a href="<cms:show k_pointer_link />"><cms:show k_nestedpage_title /></a></li>
   </cms:if>
   <cms:if k_element_end ></li></cms:if>
   <cms:if k_level_end>
      <cms:if k_level='0'>
         </nav>
      <cms:else />
         </ul>
      </cms:if>
   </cms:if>
</cms:nested_pages>
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: I assume, you are using here Nested Pages to generate menu.
Also you need to point manually every page to the template of your preference in Advanced Menu. Parent pages can be left as it is (untouched).
Try this:
Code: Select all
<cms:nested_pages masterpage='Your-Nested-Pages-Template.php' 
              extended_info='1' >
   <cms:if k_level_start >
      <cms:if k_level='0'>
         <nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id="cbp-spmenu-s1">
      <cms:else />
         <ul class="dropdown-menu">
      </cms:if>
   </cms:if>
   <cms:if k_element_start && k_immediate_children!='0' >
      <li class="dropdown"><a href="#" data-toggle="dropdown"><cms:show k_nestedpage_title /><span class="caret"></span></a>
    <cms:else />
      <li><a href="<cms:show k_pointer_link />"><cms:show k_nestedpage_title /></a></li>
   </cms:if>
   <cms:if k_element_end ></li></cms:if>
   <cms:if k_level_end>
      <cms:if k_level='0'>
         </nav>
      <cms:else />
         </ul>
      </cms:if>
   </cms:if>
</cms:nested_pages>


Thank you so much for your reply, this however did not work. It seems to be placing three of each item? Any other ideas?
Thanks. I have spotted a missing conditional here:
Change this:
Code: Select all
<cms:else />
      <li><a href="<cms:show k_pointer_link />"><cms:show k_nestedpage_title /></a></li>
   </cms:if>

to this:
Code: Select all
<cms:else_if k_element_start />
      <li><a href="<cms:show k_pointer_link />"><cms:show k_nestedpage_title /></a></li>
   </cms:if>


I have checked on my test site and it should work properly.

If it still doesn't:
Can you check if you have created the exact page structure in the template?

You should do this as per your first post:
Code: Select all
- Home, pointer to index.php
- About, pointer to about.php
- - Staff, pointer to about.php
- - History, to about.php
- Services, to services.php
etc..
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Does this work? Please, let us know. :D
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: Does this work? Please, let us know. :D


Yes that was the issue, looks to be working perfectly.

Thank you so much!
trendoman wrote: Does this work? Please, let us know. :D


Ok I noticed that the links were not generating in the menu, but the titles were.

Titles were using k_nestedpage_title to call title so I Change this:
Code: Select all
<li><a href="<cms:show k_pointer_link />"><cms:show k_nestedpage_title /></a></li>

to this:
Code: Select all
<li><a href="<cms:show k_nestedpage_link />"><cms:show k_nestedpage_title /></a></li>


Now it seems to be working with showing url.
7 posts Page 1 of 1
cron