This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

dab69574
dab69574

Hi, I'm using static pages to write many chapters of several books. When I create a menu for each book, I choose the url type. I'm interested in All Static Pages, because it has a checkbox called Replace This Item With It's Generated Children. But I want the inverse of this function: to only make links for pages at the same level as this one. So the Parent is suppressed.

Can anyone point me to the folder where I copy and modify the All Static Pages url type, and add a new option to the list: All Static Pages at This Level?

Sam Georges
Sam Georges

Hello,

If I understand correctly, I think this may be possible by creating a menu that just has All Static Pages and leave everything else as the defaults. Then inside the staticMenu component, you can right click and Expand the Markup, then remove the code that renders the children. This would give you a rendered menu that includes the top level items only.

dab69574
dab69574

Oh wow, that's cool. I will use this right click thing a lot. Unfortunately, the expanded markup shows very little code, it's just this:

        {% if staticMenu.menuItems %}
            <ul>
                {% partial staticMenu ~ "::items" items=staticMenu.menuItems %}
            </ul>
        {% endif %}

The problem with showing all static pages in the menu is that it lists chapters from other books. I only want the chapters from one book.

Last updated

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.