apostrophecms / apostrophe-sandbox

This sandbox site is the basis for our live demo. For your own projects, you can use apostrophe-boilerplate as a more streamlined, cleaner point of departure via the apostrophe-cli tool.
MIT License
112 stars 41 forks source link

Page children not populated #18

Closed MichaelMackus closed 11 years ago

MichaelMackus commented 11 years ago

This was working in a previous version of the sandbox. Currently, this seems broken and I can't seem to create a dropdown menu since this isn't working.

This example code does not work on a fresh sandbox site in that it's not showing the "relative" (child) links for subpages.

        {% for tab in page.tabs %}
          {% if tab.slug == page.slug %}
            <li class="tab current-page">{{ pageLink(tab) }}</li>
          {% else %}
            <li class="tab">{{ pageLink(tab) }}</li>
          {% endif %}

          {% for relative in tab.children %}
          {{ relative }}
          {% endfor %}
        {% endfor %}
boutell commented 11 years ago

You can do this by configuring the pages module accordingly in app.js:

pages: { types: .... your types ...., tabOptions: { depth: 2 } }

The default depth is 1 and our sandbox currently doesn't force it higher. For performance reasons we turn on these things project by project as the need indicates.

You can also set descendantOptions.

boutell commented 11 years ago

You can do this by configuring the pages module accordingly in app.js:

pages: { types: .... your types ...., tabOptions: { depth: 2 } }

The default depth is 1 and our sandbox currently doesn't force it higher. For performance reasons we turn on these things project by project as the need indicates.

You can also set descendantOptions.

On Tue, Nov 5, 2013 at 8:10 PM, MichaelMackus notifications@github.comwrote:

This was working in a previous version of the sandbox. Currently, this seems broken and I can't seem to create a dropdown menu since this isn't working.

This example code does not work on a fresh sandbox site in that it's not showing the "relative" (child) links for subpages.

    {% for tab in page.tabs %}
      {% if tab.slug == page.slug %}
        <li class="tab current-page">{{ pageLink(tab) }}</li>
      {% else %}
        <li class="tab">{{ pageLink(tab) }}</li>
      {% endif %}

      {% for relative in tab.children %}
      {{ relative }}
      {% endfor %}
    {% endfor %}

— Reply to this email directly or view it on GitHubhttps://github.com/punkave/apostrophe-sandbox/issues/18 .

Tom Boutell P'unk Avenue 215 755 1330 punkave.com window.punkave.com