SpinaCMS / Spina

Spina CMS
http://www.spinacms.com
Other
2.19k stars 403 forks source link

Allow ancestry to be set in custom pages #1261

Closed vanillaHafer closed 1 year ago

vanillaHafer commented 1 year ago

Context

Currently you are unable to nest custom pages from a theme.

Changes proposed in this pull request

Add the ability to add parent key to the custom_pages.

theme.custom_pages = [
  {name: "homepage", title: "Homepage", view_template: "homepage"},
  {name: "nested_page", title: "Nested Page", view_template: "show", parent: "homepage"},
  {name: "double_nested_page", title: "Double Nested Page", view_template: "show", parent: "nested_page"},
]

Guidance to review

If a parent is requested before a page is generated, it will not be able to be linked, however it will not blow up.