Skip to content

feat(LayoutPagesController): find layout pages by page layout - #227

Merged
tvdeyen merged 1 commit into
mainfrom
feat/layout-pages-by-page-layout
Oct 26, 2026
Merged

tvdeyen merged 1 commit into
mainfrom
feat/layout-pages-by-page-layout

Conversation

@mamhoff

@mamhoff mamhoff commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Layout pages are usually referenced by their page layout, because their urlname is derived from a name editors can change. The show endpoint only found pages by id or urlname, so clients had to use the index endpoint with a page_layout_eq filter instead.

Unlike show, index does not run load_page, so apps that hook into it to preload ingredient related objects could not do so for layout pages. Falling back to the page layout in the show endpoints of both the public and the admin controller lets clients request e.g. /jsonapi/layout_pages/footer directly. Lookups by id and urlname still take precedence, so existing requests are unaffected.

Layout pages are usually referenced by their page layout, because their
urlname is derived from a name editors can change. The show endpoint only
found pages by id or urlname, so clients had to use the index endpoint
with a page_layout_eq filter instead.

Unlike show, index does not run load_page, so apps that hook into it to
preload ingredient related objects could not do so for layout pages.
Falling back to the page layout in the show endpoints of both the public
and the admin controller lets clients request e.g.
/jsonapi/layout_pages/footer directly. Lookups by id and urlname still
take precedence, so existing requests are unaffected.

@tvdeyen tvdeyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Nice feature

@tvdeyen
tvdeyen merged commit 1051ba8 into main Oct 26, 2026
12 checks passed
@tvdeyen
tvdeyen deleted the feat/layout-pages-by-page-layout branch October 26, 2026 13:29
@tvdeyen tvdeyen added the enhancement New feature or request label Oct 26, 2026
This was referenced Oct 27, 2026
tvdeyen added a commit that referenced this pull request Oct 27, 2026
## Release v8.4.0

<!-- Release notes generated using configuration in .github/release.yml
at main -->

## What's Changed
### New Features
* feat(serializer): lazy-load relationship data by default by @tvdeyen
in #203
* feat(PageSerializer): expose robot_index and robot_follow attributes
by @mamhoff in #223
* feat(LayoutPagesController): find layout pages by page layout by
@mamhoff in #227
### Bug Fixes
* fix(IngredientPictureSerializer): Use picture_url by @tvdeyen in
#214
### Performance Improvements
* feat: Cache ingredient serializers by @tvdeyen in
#186
* Route element visibility through ElementsRepository by @tvdeyen in
#196
* refactor: load elements through core's shared element repository by
@tvdeyen in #199
* perf(Elements/Ingredients): Do not serialize timestamps by @mamhoff in
#229

## New Contributors
* @github-actions[bot] made their first contribution in
#212

**Full Changelog**:
v8.2.2...v8.4.0
---
This PR was automatically created by the prepare-release workflow.
Once merged, the gem will be automatically published to RubyGems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants