Skip to content

546 Blog detail separate page#427

Merged
absumo merged 2 commits intomasterfrom
546-blog-detail
Feb 23, 2026
Merged

546 Blog detail separate page#427
absumo merged 2 commits intomasterfrom
546-blog-detail

Conversation

@absumo
Copy link

@absumo absumo commented Feb 20, 2026

Summary by Sourcery

Add support for a dedicated blog detail page and adjust URL parameter handling accordingly.

New Features:

  • Register a separate frontend block for the blog detail view.

Bug Fixes:

  • Correct blog detail retrieval to use the first URL segment when loading posts and revisions.

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 20, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the blog detail frontend action to use the first URL segment for the post identifier and registers a dedicated Blog Detail frontend block extra in the backend installer so blog detail pages can be configured as separate pages.

Sequence diagram for blog detail request resolving first URL segment

sequenceDiagram
  actor User
  participant FrontendRouter
  participant BlogDetailAction
  participant Url
  participant FrontendBlogModel

  User->>FrontendRouter: GET /my-post-slug
  FrontendRouter->>BlogDetailAction: dispatch detail action
  BlogDetailAction->>Url: getParameter 0
  Url-->>BlogDetailAction: postIdOrSlug
  BlogDetailAction->>Url: getParameter revision,int
  Url-->>BlogDetailAction: revisionOrNull
  alt revision is null
    BlogDetailAction->>FrontendBlogModel: get postIdOrSlug
    FrontendBlogModel-->>BlogDetailAction: post
  else revision is set
    BlogDetailAction->>FrontendBlogModel: getRevision postIdOrSlug,revision
    FrontendBlogModel-->>BlogDetailAction: postRevision
  end
  BlogDetailAction-->>FrontendRouter: render blog detail page
  FrontendRouter-->>User: HTML response
Loading

Flow diagram for registering the Blog Detail frontend block extra

flowchart LR
  subgraph BackendInstaller
    Installer[Blog Installer]
  end

  Installer -->|configureFrontendExtras| InsertExtraBlog[insertExtra Blog block]
  Installer -->|configureFrontendExtras| InsertExtraDetail[insertExtra Detail block]
  Installer -->|configureFrontendExtras| InsertExtraArchive[insertExtra Archive widget]
  Installer -->|configureFrontendExtras| InsertExtraCategories[insertExtra Categories widget]
  Installer -->|configureFrontendExtras| InsertExtraRecentArticlesFull[insertExtra RecentArticlesFull widget]

  InsertExtraBlog --> ModuleExtras[Module extra records]
  InsertExtraDetail --> ModuleExtras
  InsertExtraArchive --> ModuleExtras
  InsertExtraCategories --> ModuleExtras
  InsertExtraRecentArticlesFull --> ModuleExtras

  subgraph Frontend
    BlogOverviewPage[Page with Blog block]
    BlogDetailPage[Page with Detail block]
  end

  ModuleExtras --> BlogOverviewPage
  ModuleExtras --> BlogDetailPage
Loading

File-Level Changes

Change Details Files
Use the first URL segment as the blog post identifier in the blog detail action.
  • Change the required URL parameter index for the blog post identifier from position 1 to position 0.
  • Update the non-revision blog fetch to request the post using the parameter at index 0.
  • Update the revision-specific blog fetch to request the post using the parameter at index 0.
src/Frontend/Modules/Blog/Actions/Detail.php
Register a dedicated Blog Detail block extra for use on separate frontend pages.
  • Insert a new frontend block extra with label and action 'Detail' for the Blog module alongside the existing main Blog block.
  • Keep existing blog archive, categories, and recent articles widget extras unchanged.
src/Backend/Modules/Blog/Installer/Installer.php

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider extracting the magic index 0 used in getBlogPost() into a clearly named constant or using a named parameter (if supported), so it's obvious which URL segment is expected to hold the blog id.
  • For the new Detail frontend block extra, ensure its action name and usage are consistent with other blog extras (e.g., how it will be placed and resolved), to avoid configuration drift between installer setup and actual routing/controller behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider extracting the magic index `0` used in `getBlogPost()` into a clearly named constant or using a named parameter (if supported), so it's obvious which URL segment is expected to hold the blog id.
- For the new `Detail` frontend block extra, ensure its action name and usage are consistent with other blog extras (e.g., how it will be placed and resolved), to avoid configuration drift between installer setup and actual routing/controller behavior.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@absumo absumo merged commit f4f7981 into master Feb 23, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants