Question

Photo of Dave Schuster

0

Page Menu block across sibling pages

Is there a way to include the Page Menu block and/or inherit it from the parent so it is included across the children?  We have some internal Rock pages using the pagemenu.ascx block to navigate through the siblings...  Like the sidebar on alpha rock page http://alpha.rockrms.com/page/233.  Is there a way to include that block when the page is initially created in Rock, or does that block have to be manually added to each page and subsequently maintained individually if there are any included external links added to the end of the lava. 

Initially thought the an html context might work, but Page isn't available in those blocks.

Trying to get away from having to manually edit the following block of lava in the block's template on each page:

<ul class="nav nav-pills">
    {% for childPage in Page.Pages %}
        <li {% if childPage.Current == 'true' %}class='active'{% endif %}>
            <a href="{{ childPage.Url }}">{{ childPage.Title }}</a>
        </li>
    {% endfor %}
    <li><a href="external link" target="_blank">Link</a></li>
</ul>

Blocks
  • Photo of Scott Conger

    0

    There is probably more than one way to do that.  If I were to try that, I'd create a new layout aspx that contains the menu.  Then anytime you add a new page, select that new layout.

    The PersonDetail.aspx in the Theme Layout directory is a more complex example but it already included several items on the top half of the screen.  The PersonDetail.aspx is the layout used for the internal person edit screen.  PersonDetail layout is used for each tab.  It automatically adds the top half of the screen: bio, badge, family.  I'm not suggesting you use the PersonDetail for your menu, I'm just pointing out that it has content associated with it automatically, unlike the other layouts.  So, you can make your own layout with your menu, then reuse your layout for each page.