cancel
Showing results for 
Search instead for 
Did you mean: 

Feature Request: Make "Widget Instance" admin page more extensible

0 Kudos

Feature Request: Make "Widget Instance" admin page more extensible

Feature request from CodeMonkey90, posted on GitHub Aug 04, 2014

Some time ago, I've written a module that generates a "category" page (product list) for each manufacturer. Naturally, our client wanted to be able to add CMS blocks to certain manufacturer pages, so I made my extension generate layout handles and took a look at the Widget Instance editor to figure out how to extend the "Layout Updates" chooser properly to allow users to select certain manufacturers like you can already select products and categories. After looking at the code for some hours (especially the JavaScript code), I eventually gave up and added another grid to the backend which allows users to associate manufacturers with CMS Blocks.

The solution I ended up with is not very flexible and kind of defeats the purpose of the "Widget Instance" admin page. It would be great if that could actually be a centralized point where users could add Widgets to arbitrary pages, like it's supposed to be. But so far, there doesn't seem to be a way to extend it properly for modules which generate layout handles dynamically. It would be great for both module developers and admin users if this possibility could be added.

2 Comments
New Member

Comment from verklov, posted on GitHub Jan 20, 2015

Hello @Landkeks! I am trying to understand the essence of your request, but frankly saying cannot so far.

In the first paragraph you are saying that your extension generated category pages for each manufacturer. I assume this is based on the value of the Manufacturer field for products.

In the second paragraph you are talking about inability to add widgets to specific pages or categories, if I am not mistaken. This is actually possible in Magento.

Could you please help me understand the idea behind your request? Thank you!

New Member

Comment from CodeMonkey90, posted on GitHub Jan 20, 2015

Hi @verklov! I'm sorry if my original post was a bit confusing.

Yes, my extension generates pages for each manufacturer based on the manufacturer field for products. I want to allow backend users to add widgets to those pages, via the existing UI (CMS → Widgets).

In Magento 1.x, when you add a new widget instance, you can add layout updates to determine where that widget instance is supposed to appear. Magento allows backend users to easily select specific product/category pages. The problem is that the JS/PHP logic for that page was written only with those use cases in mind. There is no clean way for my extension to hook into that page and allow backend users to select specific manufacturer pages just like they can select specific product pages.

Since having multiple UIs for the same task is not very user-friendly, I think it should be easier for Magento extensions to hook into that page and allow the user to select custom dynamically generated layout handles via the existing UI.