Closed marisks closed 6 years ago
Glimpse of upcoming feature:
[ContentType(...)]
[DefaultDisplayOption(ContentAreaTags.HalfWidth)]
[DefaultDisplayOptionForTag("ca-tag", ContentAreaTags.OneThirdWidth)]
[DefaultDisplayOptionForTag("ca-tag2", ContentAreaTags.ThreeQuartersWidth)]
public class SomeBlock : BlockData
{
}
DefaultDisplayOptionForTag
regulates which DisplayOption
will be chosen by default if Content Area was rendered with tag Html.ContentArea(m => m.ContentArea, new { tag = "..." })
New feature will control default display option from block's perspective at the moment though.
another upcoming feature:
public class StandardPage : PageData
{
[DefaultDisplayOption(ContentAreaTags.OneThirdWidth)]
public virtual ContentArea MainContentArea { get; set; }
}
@valdisiljuconoks Is it possible to set the default DisplayOption for Block from inside the Block model, like you can do with the Additional Styles? It would be handy when migrating from another renderer with DisplayOption already set into Block.
hi,
you mean not like this with attributes:
[ContentType(...)]
[DefaultDisplayOption(ContentAreaTags.HalfWidth)]
public class Block { ... }
but from the block content type code itself?
not at the moment, but it might be pretty easy to add..
Yes, from the block content type code itself. This might also be possible to achieve by using "Modify Block Start Element" technique, but I'm having difficulties to get it work. I'm converting old webforms site to MVC razor and trying to replace rendering engine used in web forms to this one. Such a mess. 🙈
hahhaaa.. that's phrase I haven't seen for a while good luck! :)
what do you think - who would win if you are dropping block with display option (DO1) set via attribute, having also override in method (DO2) into the content area with default display option set to DO3?
Tough one. The most inner/specific setting (DO2) should be the winner?
moved to new issue #35
It would be great if default width of the block could be added for content area. The setting could be configured through attribute on content are property like:
If "one-third" does not exist, fallback to full width.