Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for "Include Page List" in pageNav & pageSubNav Lava Templates #2530

Closed
1 task done
briankalwat opened this issue Oct 11, 2017 · 6 comments
Closed
1 task done
Labels
Priority: Low Affects a small number of Rock installations and will not be noticed by most users. Status: Available The core team has made this available for the community to fix. (was: Status: Available) Topic: Lava Related to the Lava templating language. x-Fixed in v9.0
Milestone

Comments

@briankalwat
Copy link
Contributor

briankalwat commented Oct 11, 2017

Prerequisites

Description

The out-of-the-box lava templates for pageNav and pageSubNav do not support the "Include Page List" function of the PageMenu block (from what I could tell). The lava below appends the "Include Page List" pages below the child pages. I'm not sure if this is the best way to add support, or which lava templates need it added to them, but I thought i'd start the conversation. @edmistj do you have thoughts?

<section class="nav-sub">

{% if Page.DisplayChildPages == 'true' and Page.Pages != empty %}
    <div class="list-group">

        {% for childPage in Page.Pages %}
            <a href="{{ childPage.Url }}" class="list-group-item {% if childPage.Current == 'true' %}active{% endif%}">
                {{ childPage.Title }}
            </a>
        {% endfor %}

        {% for includedPage in IncludePageList  %}
            {% assign path = 'Global' | Page:'Path' %}
            {% assign attributeParts = includedPage | PropertyToKeyValue %}
            <a href="{{ attributeParts.Value }}" class="list-group-item {% if path == attributeParts.Value %}active{% endif%}">
                {{ attributeParts.Key }}
            </a>
        {% endfor %}

    </div>
{% endif %}

</section>

Steps to Reproduce

  1. Add PageMenu block to a page.
  2. Use pageNav.lava or pageSubNav.lava
  3. Add Pages to the "Include in Page List" field

Expected behavior:

Include Page List should be output in the block.

Actual behavior:

Include Page List is ignored.

Versions

  • Rock Version: 6.9
  • Client Culture Setting: en-US

┆Attachments: image.png

@cabal95 cabal95 added Priority: Low Affects a small number of Rock installations and will not be noticed by most users. Topic: Lava Related to the Lava templating language. labels Oct 11, 2017
@jonedmiston jonedmiston added the Status: Available The core team has made this available for the community to fix. (was: Status: Available) label Oct 12, 2017
@jonedmiston
Copy link
Member

@briankalwat when doing the PR could you add this to all the themes with this Lava asset?

briankalwat added a commit to NewSpring/Rock that referenced this issue Oct 15, 2017
@cabal95
Copy link
Member

cabal95 commented Oct 24, 2017

@briankalwat I see that you added a commit but not a pull request yet. Is there more code work that you need to do or does it just need the PR created?

@briankalwat
Copy link
Contributor Author

@cabal95 honestly I've been having trouble figuring out how to open the PR as our fork of the repo isn't in sync + not being familiar with which branch to open the PR to, etc. I tried to figure it out but should have just asked for help when I got stuck.

@cabal95
Copy link
Member

cabal95 commented Oct 25, 2017

No worries. I'll see if I can get with you on Slack to either help you get a PR going yourself or maybe pulling the change and submitting one myself. (I'm out for the rest of the date)

@briankalwat
Copy link
Contributor Author

I'd love to learn the process so I can contribute more in the future!

@bilkie1
Copy link

bilkie1 commented Feb 27, 2023

In version 13.7 this implementation is missing from the PageSubNav.lava in the Stark Theme after the first {% endfor %}

     {% for includedPage in IncludePageList %}
        {% assign path = 'Global' | Page:'Path' %}
        {% assign attributeParts = includedPage | PropertyToKeyValue %}
        <li{% if path == attributeParts.Value %} class="active"{% endif %}>
            <a href="{{ attributeParts.Value }}">{{ attributeParts.Key }}</a>
        </li>
    {% endfor %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Affects a small number of Rock installations and will not be noticed by most users. Status: Available The core team has made this available for the community to fix. (was: Status: Available) Topic: Lava Related to the Lava templating language. x-Fixed in v9.0
Projects
None yet
Development

No branches or pull requests

6 participants