We insert an (own) widget to a CMS page using the button.

There is no prompt for the template. Is it possible to choose the template in the Widget insertion GUI for CMS content or does this have to be done manually in the source-code view?


You have to specify the list of available templates for the widget. Here is how it's done for the new products widget in catalog module (see my comments inline):

    <value>catalog/product/widget/new/content/new_grid.phtml</value><!-- default value -->
    <values> <!-- possible values -->
        <default translate="label"><!-- key name -->
            <value>catalog/product/widget/new/content/new_grid.phtml</value><!-- template name -->
            <label>New Products Grid Template</label><!-- label show in selector -->
        <list translate="label">
            <label>New Products List Template</label>

For the <values> field you can even specify a source model (just like you do for system -> configuration dorpdowns).

    <source_model>adminhtml/system_config_source_yesno</source_model><!-- for a yes/no field-->
  • 1
    Great - what I was missing were the nodes: <template translate="label"> <label>Template</label> <visible>1</visible> <required>1</required> <type>select</type> </template> Without those the template can be chosen at widget instances, but not in the CMS.
    – Alex
    Jul 2 '13 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.