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

parent order-by collection setting ignored in flex-pages UI #2881

Closed
rhukster opened this issue Apr 15, 2020 · 1 comment
Closed

parent order-by collection setting ignored in flex-pages UI #2881

rhukster opened this issue Apr 15, 2020 · 1 comment
Assignees

Comments

@rhukster
Copy link
Member

Just noticed this that the column is not ordered based on this setting in 'advanced' tab of the parent. It should be.

@rhukster rhukster added the 1.7 label Apr 15, 2020
@rhukster rhukster self-assigned this Apr 15, 2020
@mahagr mahagr added the bug label Apr 22, 2020
@rhukster
Copy link
Member Author

Notes:

Setting is done per page (needs to be in a page with collection defined, e.g. blog.md)

admin:
    children_display_order: collection  

Logic is done in admin/themes/grav/templtaes/pages.html.twig:

{% if page.header.admin.children_display_order == 'collection' and page.header.content.order.by %}
        {% if page.header.content.order.custom %}
            {% set pcol = page.children().order(page.header.content.order.by, page.header.content.order.dir|default('asc'), page.header.content.order.custom) %}
        {% else %}
            {% set pcol = page.children().order(page.header.content.order.by, page.header.content.order.dir|default('asc')) %}
        {% endif %}
    {% else %}
        {% set pcol = page.children() %}
    {% endif %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants