Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Modular page items order through blueprint array

Started by Muut Archive 9 years ago · 0 replies · 568 views
9 years ago

I tried to make a blueprint for a modular page in blueprints/modular.yaml to order modular page items.

As described in the skeletons, I tried to override the content.order.custom key and it's array items in the page with the modular template and the following custom order:
--- yaml
custom:

  • _slider
  • _categories
    YAML
    through a drag and drop array list in the `modular.yaml` blueprint (truncated):
    --- yaml
    header.content.order.custom:
    type: array
    value_only: true
    

    It works. The blueprint can manipulate the entries in content.order.custom, but, when I drag and drop, the blueprint form changes the list type into an indexed hash:
    --- yaml
    custom:
    1: _categories
    0: _slider

    TXT
    
    therefore, the order does not really change, as the page.collection method (correctly) interprets the indexed hash as an array by using their (unchanged) index.
    

Any suggestions how to solve that issue?

Ordering modular page items could be so simple with that blueprint.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1318 9 years ago
Archive · by Muut Archive, 9 years ago
2 915 9 years ago
Archive · by Muut Archive, 9 years ago
2 4044 9 years ago
Archive · by Muut Archive, 9 years ago
1 2920 9 years ago
Archive · by Muut Archive, 9 years ago
3 1104 9 years ago