clay / amphora

Middleware for Express that composes components into renderable pages
https://claycms.gitbooks.io/amphora/
MIT License
31 stars 23 forks source link

Add 'renderOrder' property to schema to decide in which order components render #684

Open micaww opened 4 years ago

micaww commented 4 years ago

This allows you to specify a renderOrder property in the _component or _componentList property of a layout or component's schema.yml to determine the order in which components get rendered.

All component or component-lists that don't specify this property will default to 1.

Ex:

col1:
   _componentList:
      renderOrder: 1
      include:
         - some-component

col2:
   _component:
      renderOrder: 2
      include:
         - some-component
coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 2446


Totals Coverage Status
Change from base Build 2440: 0.0%
Covered Lines: 4249
Relevant Lines: 4249

💛 - Coveralls
olsonpm commented 4 years ago

Whoops, this PR also needs to add documentation for the new schema property. And i'm not sure, but this seems like the second schema property that affects behavior outside kiln, the other being version. I note this because the kiln docs say the schema is

the main connective tissue between components and Kiln.

so the clay team may want to keep that in mind with docs regarding the schema file