Situation
One of the grocery stores has the following business requirements:
- Add a news feed with:
- News categories
- Add a recipe list with:
- Recipe filtering
- Cross-links with products: each recipe may be linked with ingredients from the product catalog, and relevant recipes should appear on the product page
A general approach to implementing these requirements is the following:
- Create custom item types:
- News item type. One of the attributes is a category, or a list of categories.
- News category item type.
- Recipe item type.
- Relation: Recipe <-> Product (N:N)
- Create custom CMS page controllers:
- News page controller
- News list. Shows a list of news items.
- News details. Shows the selected news page.
- News category navigation. Shows a list of categories.
- Recipes controller
- Recipe list. Shows a list of recipes.
- Recipe details. Shows the selected recipe page.
- News page controller
Complexity
There are a lot of existing news items and recipes that are supposed to be migrated from the existing website. The client may also need to add search capabilities in the future, as well as filtering and tagging.
Challenge
How can we speed up development without losing flexibility? How can we leverage existing hybris functionality?
Solution
The solution is to use the product data model to store non-product items such as news and recipes. An additional product type should be added. Product categories will serve as news categories. Product detail pages might be used for news details and recipe details. News and recipes could be stored in the SOLR index to reuse product list and search results capabilities and templates.
However, this solution has its pros and cons. Using unsuitable objects for news and recipes could make the solution less clear. Some side effects could occur as well, especially if hybris content development has not been harmonized with hybris commerce development.
© Rauf Aliev, June 2016