It would make sense to add a mode=block/inline to the $slot (or $fill) widgets?

I am designing my first sophisticated custom widget, and wow, the power is fantastic.

However if I design a header and footer slot as an example despite the fact I know these will always be used in block mode, I can’t encode this on the $slot widget, which is after all a kind of minimalist transclude.

  • The result is when calling the widget and defining $fill items I still need to leave a first blank line after the opening of the $fill widget.
  • This is an unnecessary requirement we could overcome, and calling a widget with lots of empty lines (after the fill and not between the fill especially) makes it much less readable.
  • It would remain backwardly compatible if there were no mode parameter, and that is to determine it from the fill widget content.

There may be some cases where being able to set it on the fill widget would be useful in the future so it can be change in the widget call and not forcing modification of the custom widget.

If both fill and slot were able to set the mode it would be as follows;

  • Neither fill or slot has a mode parameter - Automatic at present based on the content of the fill widget
  • If the slot has the mode set to block or inline (but not the fill widget) then use that mode.
  • If the fill has the mode set to block or inline (whether or not the slot widget) then use that mode, before setting the slot mode. Ie the $fill widget wins, is dominant.

Please discuss, I can raise and issue if its valid.

1 Like

Just encountering this issue now – I would definitely appreciate this as well!

1 Like

Create a GH issue otherwise it will be forgotten