Before v3.7.4, the contentOf helper behavior was to fallback silently on empty string, if a content was not provided for the named block.
A typical usage for this fallback behavior was to override a block, just if needed: for instance, I want to define a custom style section in my HTML page, but if the contentFor the style section is not provided, I just want to fallback with a blank line.
I like the fact the behavior is now more rigorous, that's a good thing to know your block is not set properly. The good approach here (in my opinion) is to allow contentFor to accept a default block content. If this default block is not provided, then it can go the error state.
Before
v3.7.4
, thecontentOf
helper behavior was to fallback silently on empty string, if a content was not provided for the named block.A typical usage for this fallback behavior was to override a block, just if needed: for instance, I want to define a custom style section in my HTML page, but if the
contentFor
thestyle
section is not provided, I just want to fallback with a blank line.I like the fact the behavior is now more rigorous, that's a good thing to know your block is not set properly. The good approach here (in my opinion) is to allow
contentFor
to accept a default block content. If this default block is not provided, then it can go the error state.Thoughts?