Skip to main content

Use product list template with my own product collection?

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard product listing using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

EDIT2:

Got somewhere by adding this to my layout but by default it just shows all products. Possible to change the products displayed in the block?

<block class="Magento\Catalog\Block\Product\ListProduct" name="ymmResult" template="Magento_Catalog::product/list.phtml" />
Tyler
  • 273
  • 1
  • 6
  • 16