Skip to content

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Jan 12, 2026

Motivation

  • Provide a PrettyBlocks block that displays the latest blog posts following the provided mockup.
  • Let the admin enable a Bootstrap slider and control items per slide on mobile and desktop as well as the total number of posts.
  • Reuse existing formatting helpers so posts appear with thumbnails, excerpts and category links.
  • Offer a CTA linking to the full blog.

Description

  • Register a new PrettyBlocks block in hookActionRegisterBlock with config fields bootstrap_slider, items_per_slide_mobile, items_per_slide_desktop and total_posts.
  • Add hookBeforeRenderingEverpsblogLatestPosts which fetches posts via EverPsBlogPost::getLatestPosts, formats them with formatPrettyBlocksPost and exposes blog_url.
  • Add the rendering template views/templates/block/latest-posts.tpl implementing responsive Bootstrap carousels (mobile/desktop) and a non-slider grid fallback.
  • Add safe defaults and minimums for items_per_slide_* and total_posts (default 6) to avoid invalid values.

Testing

  • No automated tests were executed for this change.

Codex Task

@CySSoO CySSoO merged commit 24ae101 into master Jan 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants