I’m new to PyroCMS and struggling to figure out how to implement something.
Say I have a list of products I want to display. Each item in the list shows a photo of the product, a description, and its price. This listing of products can be used on the homepage (e.g. displaying a few products), or in the search results (e.g. a SERP), or a browse page, etc.
I should be able to create one “thing” that has all the markup needed for this listing, along with it being able to accept parameters (e.g. only get the top 5 items to display on the homepage). Problem is I don’t know what this “thing” should be: module, plugin, or widget?
Suggestions?
Do you need to be able to manage the products via control panel? Then you at least need to start by creating a module. From the glossary:
From there, the line gets a bit blurry:
If I remember correctly, both plugins and widgets accept parameters. The main difference is that widgets get assigned to specific template areas, while plugins can be embedded in content anywhere you want with {tags}. Since this is going to be embedded in the content of only certain pages, I’d go with a plugin.