Recommended Articles in Market PRO, a plugin for Cotonti. On the product page, we show the necessary blogs and pages that we assign when editing the product card.
Introduction and Overview
Featured Articles in Market PRO is an extension for Cotonti Siena designed for manual linking of articles (the Page module) to products of the Market module. The plugin solves a practical task: displaying relevant, pre-selected materials on the product page, enhancing content depth, SEO value, and conversion.
Unlike automatic recommendations based on categories or tags, this solution relies on explicit editorial logic: the administrator or product author manually selects which articles should be considered featured. This makes the plugin especially useful for marketplaces, service showcases, SaaS catalogs, and content-driven commercial projects.
The extension is deeply integrated into the Cotonti ecosystem, uses standard hooks, templates, and access controls, and correctly interacts with additional plugins such as attacher and i18n.
Concept and Architecture of the Solution
The plugin is based on a simple and scalable idea:
a separate relations table is created between Market products and Page articles.
Each relation is:
- unique (one “product → article” pair),
- ordered (display order is explicitly defined),
- independent of categories, tags, or site structure.
This means that:
- one product can have multiple featured articles;
- one article can be featured for multiple products;
- the display order is always manually controlled.
Architecturally, the plugin is divided into three logical layers:
- Data storage layer — the relations table.
- Administrative layer — the article selection interface in the product edit form.
- Public layer — displaying the recommendations block on the product page.
Data Structure and Relation Storage
A dedicated database table is used to store relations.
Each record contains:
- the product identifier,
- the article identifier,
- the display order value.
A unique constraint is applied to the “product–article” pair, fully preventing duplicates. Additional indexes ensure fast queries both in the edit interface and on the public product page.
When a product is deleted, the plugin automatically removes all related records, preventing orphaned relations.
Integration into the Administrative Area (Market Edit)
General Logic
When editing a product in the Market module, the plugin adds a separate visual block with selectors for featured articles. The number of available slots is defined by the plugin configuration.
Each slot:
- represents a visual selector,
- stores the selected article ID in a hidden field,
- is fully synchronized with server-side logic.
AJAX Article Search
Article search is implemented via AJAX and works based on page titles.
Key features:
- minimum query length — 2 characters;
- only published pages are included;
- the currently edited page is excluded;
- for non-admin users — strict filtering by owner.
This approach simultaneously:
- protects against errors,
- simplifies the interface,
- prevents exposure of чужого content.
Access Control
The plugin strictly follows the Cotonti permission system:
- administrators can see and select any articles;
- regular users — only their own.
This makes the logic fully compatible with multi-author projects.
Saving and Updating Relations
After saving a product:
- all previous relations are removed,
- a new set of relations is created according to the current selection.
Additional checks are performed:
- self-selection is excluded;
- duplicates are excluded;
- article existence and publication status are verified;
- the maximum number of recommendations is respected.
The save order matches the slot order in the form, ensuring predictable output.
Public Display on the Product Page
Entry Point and Display Conditions
The plugin connects via a standard Market output hook and generates a dedicated template tag. The recommendations block is displayed only if:
- the plugin is active,
- the product has related articles.
This allows flexible control over rendering directly in the theme template.
Multilingual Support (i18n)
If the i18n plugin is active, Featured Articles in Market PRO:
- loads translations of the product itself,
- loads translations of the featured articles,
- correctly processes category translations.
If a translation is missing, the default content version is used, preventing empty blocks and display errors.
Building the Featured Article Card Content
For each article, a complete card is generated:
- title,
- description,
- category,
- image,
- link.
Text and Description
If the article has a short description, it is used.
Otherwise, the main text is taken, cleaned of HTML, normalized, and neatly truncated to the configured length.
This ensures:
- clean text without noise,
- correct previews,
- a stable and consistent block appearance.
Image Handling
Images are resolved using the following priority:
- the first attached image via the attacher plugin;
- a global fallback image from plugin settings;
- the extension’s default placeholder image.
This guarantees that the card always has a visual anchor, even if the article contains no media.
Templates and Customization
The plugin uses its own templates:
- for the product edit form;
- for the public recommendations list.
They are fully isolated from the core and can be easily overridden in the site theme.
The templates include:
- conditional blocks,
- responsive layout,
- subtle hover effects,
- semantically correct structure.
Performance and Security
The plugin:
- uses prepared statements,
- caches page data,
- minimizes the number of SQL queries,
- performs no unnecessary logic when no relations exist.
All input data is filtered using standard Cotonti tools, and output is escaped, preventing XSS and logical vulnerabilities.
Practical Use Cases
The plugin is ideal for:
- linking manuals and instructions to products;
- displaying case studies and reviews;
- strengthening product page SEO;
- increasing time on page;
- manual “recommended reading” selections.
It is especially effective in projects where content is part of the sales funnel.
Conclusions
Featured Articles in Market PRO is a mature, well-thought-out, and professionally implemented extension for Cotonti Siena.
Key strengths:
- strict architecture and clean logic;
- full integration with the Cotonti API;
- access control and multilingual support;
- a convenient editorial interface;
- high flexibility and customizability.
The plugin does not impose automatic decisions but gives editors full control — exactly what is required for high-quality commercial and content-driven projects.
Permanent link to the current source code of the plugin repository on GitHub.
Buy Featured Articles in Market PRO (for Cotonti CMF) at low prices. The online store offers to order Featured Articles in Market PRO (for Cotonti CMF), view the full description, detailed specifications, product photos and current discounted prices