Ticket

Attaching a Zone option to Widget Elements?

Hi all, I had an interesting situation where jtkech came to the rescue in:

http://orchardpros.net/tickets/10775 [not important to read]

and sorted my dilemma regarding the rendering of widgets from a layout into other zones. Along the way Sipke suggested attaching custom display types as an option to widget elements…"this could be done as a simple property we would add to the widget elements, which would be quite easy to do".

With that in mind, would it be possible to add a global [or local if people so desired] Zone property to widget elements; 'as in, if the user selected zone-aside or the likes from the suggested widget property, that's exactly where it would render? For with a small design change, this could make things so much more functional than what I have and I also believe it would be a very handy feature as a whole. Interested in your thoughts? Thanks in advance, Pug.

Re: Attaching a Zone option to Widget Elements?

So if I understood properly, you'd like to manage widgets that won't be in the layout, from the layout? That sounds completely backwards to me. We already have a way to manage widgets in global zones, and layout should have nothing to do with it. I'm struggling to find any advantage to this, but maybe I misunderstood.

Saturday, August 13, 2016 2:46:06 AM bybleroy
  • bleroy
  • Lv. 08 Rookie
  • Total EXP: 527

Re: Attaching a Zone option to Widget Elements?

No, widgets that are in layouts [widget.element] that can be placed outside of the layout into other zones. By itself, I can't imagine there being a strong use case [but i havent thought about that much], but when you have layouts contained in projections, nested in #n depth projections, it would be exceptionally handy - or, you face what happened to me recently in the linked ticket. Thanks for the interest bleroy, Pug

Saturday, August 13, 2016 3:08:30 AM bypug
  • pug
  • Lv. 04 Rookie
  • Total EXP: 144

Re: Attaching a Zone option to Widget Elements?

I'm really not convinced, but if you must, how about creating your own widget element that has those capabilities, in your own module?

Saturday, August 13, 2016 3:20:00 AM bybleroy
  • bleroy
  • Lv. 08 Rookie
  • Total EXP: 527

Re: Attaching a Zone option to Widget Elements?

...I would love to, but as jtkech really nutted out my ticket scenario in a way I would have never thought, I doubt my skills are up to the task? Do you know of any existing Orchard content that could be of assitance to get the ball rolling [other than widget.element iteself] - thanks

Saturday, August 13, 2016 3:33:37 AM bypug
  • pug
  • Lv. 04 Rookie
  • Total EXP: 144

Re: Attaching a Zone option to Widget Elements?

@bleroy: actually, what would probably be more handy and more extensive than what I proposed, is making a custom rule that you could insert in layout.elements visibility [or the likes] that could be conditional, as in:

if url('~/'), then Zone("WidgetName", "layout.foo") - what do you think?

Saturday, August 13, 2016 5:43:51 AM bypug
  • pug
  • Lv. 04 Rookie
  • Total EXP: 144

Re: Attaching a Zone option to Widget Elements?

That's not how rules work. Rules determine the visibility of the layer, that's it. It doesn't determine what widgets are in the layer, or what zone the widget targets. Still not sure why you want to do this.

Monday, August 15, 2016 8:28:50 AM bybleroy
  • bleroy
  • Lv. 08 Rookie
  • Total EXP: 527

Re: Attaching a Zone option to Widget Elements?

Yeah, I realise that about rules bleroy - I wasn't very descriptive sorry. What I meant is, I believe "that" added functionality would assist situations such as my own: create once, display many. I have pages that are reformed to suit the site and/or url, and/or current projection they are contained in at the time [often nested several levels deep] into many varying situations. Using placement files are brilliant for individual content items/widgets, but when you have layouts as the container, restructuring the elements within [namely widget.elements in my case] - is a complete nightmare; i.e, manual coding/overrides that aren't user friendly or extensive. Unless you know of a way that currently exists to rezone such layout.widget.elements into Global zones etc. from a Layout [ ? ], I believe people would use this ability; for although it's painful due to its implementation, I'm using jktech's solution to great effect.

Tuesday, August 16, 2016 12:44:27 AM bypug
  • pug
  • Lv. 04 Rookie
  • Total EXP: 144

Re: Attaching a Zone option to Widget Elements?

Not sure this is a good idea, but you could override the widget element shape template and add the shape to be rendered to any global zone. This zone could be made configurable on the element (or you couldimpement your own widget element as Bertrand suggested).

Monday, September 26, 2016 11:44:19 PM bysfmskywalker

Post a reply

You need to be signed in to post a reply.

Sign In