Problem with custom menu

Hi to all

Can somebody help me with small issue

I want to create two custom menu with icons and counter in sidebar. Html is here

<ul class="sidebar-panel nav">
    <li class="sidetitle">SITE NAVIGATION</li>
    <li><a href="(page-url)"><span class="icon color1"><i class="fa fa-(icon-name)"></i></span>(page-name) <span class="label label-default">(count-of-real-subpages)</span><span class="caret"></span></a>
    <ul>
        <li><a href="(not-real-sub-page-url)"><span class="icon"><i class="fa fa-(icon-name)"></i></span>(not-real-sub-page-name)</a></li>
        <li><a href="(not-real-sub-page-url)"><span class="icon"><i class="fa fa-(icon-name)"></i></span>(not-real-sub-page-name)</a></li>
        <li><a href="(not-real-sub-page-url)"><span class="icon"><i class="fa fa-(icon-name)"></i></span>(not-real-sub-page-name)</a></li>
     </ul>
    </li>
    <li><a href="(page-url)"><span class="icon color3"><i class="fa fa-(icon-name)"></i></span>(page-name) <span class="label label-default">(count-of-real-subpages)</span></a></li>
    <li><a href="(page-url)"><span class="icon color9"><i class="fa fa-(icon-name)"></i></span>(page-name) <span class="label label-default">(count-of-real-subpages)</span></a></li>
</ul>
    <ul class="sidebar-panel nav">
      <li class="sidetitle">MORE</li>
      <li><a href="(page-url)"><span class="icon"><i class="fa fa-(icon-name)"></i></span>(page-name)</a></li>
      <li><a href="(page-url)"><span class="icon"><i class="fa fa-(icon-name)"></i></span>(page-name)</a></li>
      <li><a href="(page-url)"><span class="icon"><i class="fa fa-(icon-name)"></i></span>(page-name)</a></li>
    </ul>

Any Ideas how can I create it? I think to made structure field for site.txt with page field.
But I have some questions… Is it works with multilang? How to count and show count number of subpages? Have ability to sort menu items (delete/edit)?

Could you pls. be more specific regarding what you want to achieve? I have no idea what you mean by real subpages and not real subpages …:confused:

Ok, I will try to show site structure

Home page
Bikes (redirect to home page)

  • Model 1 (real sub pages)
  • Model 2
  • Model 99
    Bikes by color (not real sub pages)
    Bikes by type
    Bikes by price

In menu I don’t need to show all real sub pages, I need to show already filtered pages by custom fields that group bikes

So you basically want to include more items in your menu that come from a structure field instead of the subpages?

I think I found decision

I have only 2 problems left

  1. How to count number subpages of page if I know only page slug?

  2. How to insert second level of menu if all made it on structure field? Maybe add to menu checkbox or radio button that some item is SUB item ? Or insert one more menu inside this menu?

    • PAGE 1
      • SUB PAGE 1
      • SUB PAGE 2
    • PAGE

If the page is on the first level:

<?php
$noOfSubpages = page('name_of_parent_page')->children()->count()
?>

I’d use a checkbox or radio button to indicate that item is subitem.

1 Like

Thanks :slightly_smiling: