How do I change the number of columns for the New Products grid widget in Magento?
I know I have to update the layout.xml
file somehow but I'm not sure what to insert.Or maybe do I have to do a layout update 开发者_StackOverflow中文版in the CMS pages that include the widget?
If you are using CMS page content as widget container:
It is pretty simple, just add column_count parameter in {{widget type="widget_type" parameter1="value" column_count="your_value"}}
directive.
By the way widget it is a standard Magento block with some pre-configurations, so you can easily specify any block parameter within {{widget}}
directive.
If you want to use Widget functionality, you can create etc/widget.xml
in your custom module with this XML:
<widgets>
<new_products>
<parameters>
<column_count translate="label">
<required>1</required>
<visible>1</visible>
<value>5</value> <!-- default parameter value -->
<label>The number of Products in a row</label>
<type>text</type>
</column_count>
</parameters>
</new_products>
</widgets>
It will add a new field to widget form, where an admin user will be able to enter the number of products in a single products row
Have fun with Magento =)
精彩评论