cancel
Showing results for 
Search instead for 
Did you mean: 

Add a Template to Core Widget

Add a Template to Core Widget

I wante to add a template to the catalog product list widget. Currently there is only a grid template. Anyone know how this is done?

1 REPLY 1

Re: Add a Template to Core Widget

I've gotten a little further with this.  I can easily add an option by creating a new module with this in /app/code/Vender/Module/etc/widget.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
    <widget id="products_list">
        <parameters>
            <parameter name="template" xsi:type="select">
                <options>
                    <option name="homepage" value="product/widget/content/homepage.phtml">
                        <label translate="true">Homepage Template</label>
                    </option>
                </options>
            </parameter>
        </parameters>
    </widget>
</widgets>

But Magento won't use the template unless I put it here: /vendor/magento/module-catalog-widget/view/frontend/templates/product/widget/content/ which doesn't seem right.  I would think it'd be better here: /app/code/Vender/Module/view/frontend/templates/product/widget/content/