SEO-Saurus - Real-time development and web experiments
seo-saurus

Elevating the Blog Experience: Smoother Comments, and Pagination with SEO-Friendly URLs

In the latest round of blog updates, I’ve introduced several key features to create a smoother, more organized experience for readers and backend editors alike.

Improved Comments Experience

To enhance engagement, the comment section now scrolls automatically to the latest comment after submission, ensuring users see their input instantly. For moderation, backend users now have the ability to remove comments directly, streamlining content control.

Advanced Pagination Techniques

For better navigation, I integrated a new pagination method using TYPO3’s QueryResultPaginator and SlidingWindowPagination. For each paginated page, the URL reflects the structure (e.g., /page-5), enhancing user experience and boosting SEO with a greater number of indexable pages.

Here’s a look at the key code that makes this possible:

routeEnhancers:
Blog:
routes:
-
routePath: '/'
_controller: 'Blog::list'
-
routePath: '/page-{page}'
_controller: 'Blog::list'
_arguments:
page: page
aspects:
page:
type: StaticRangeMapper
start: '1'
end: ‘1000’

This YAML configuration defines the route enhancer for pagination, ensuring the first page is displayed simply with /, while subsequent pages follow a clean, logical structure.

For the first page, we avoid using any page attribute, which allows us to use the initial route configuration without appending additional parameters. Here’s how you can manage this in Fluid:

<f:if condition="{pageNumber} == 1">
<f:then>
<f:link.action action="list">Page 1</f:link.action>
</f:then>
<f:else>
<f:link.action action="list" arguments="{page: pageNumber}">Page {pageNumber}</f:link.action>
</f:else>
</f:if>

To further improve visibility, each paginated page has a distinct title with a “Page X” prefix, which helps search engines understand the structure and order of the pages.

With these improvements, the blog offers a more engaging and SEO-friendly experience—an upgrade that keeps both users and search engines in mind!

Comments

Follow me