You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all views in a specific collection are assigned the "view types" of the collection. But there is no reason individual views couldn't also/alternatively have other view types. I think the rule would need to be that a view has all of the collection's view types, maybe more, but no less.
If we support that, then we can add support for "automatic type detection", for at least some cases. For example, we know that a view is a layout view type if it has a {% body %} tag, and we know that a view is a block view type if it has blocks. But we couldn't automatically detect partials, or pages - since it would be ambiguous.
Initially I was thinking this is something a user could do with an .onLoad middleware, but I don't think that's an ideal solution. If we instead allow the user to optionally enable auto-detection, we can have built-in caching and detection for views that ensures views of the correct type are used at certain points in the render cycle.
The text was updated successfully, but these errors were encountered:
Currently, all views in a specific collection are assigned the "view types" of the collection. But there is no reason individual views couldn't also/alternatively have other view types. I think the rule would need to be that a view has all of the collection's view types, maybe more, but no less.
If we support that, then we can add support for "automatic type detection", for at least some cases. For example, we know that a view is a
layout
view type if it has a{% body %}
tag, and we know that a view is ablock
view type if it has blocks. But we couldn't automatically detect partials, or pages - since it would be ambiguous.Initially I was thinking this is something a user could do with an
.onLoad
middleware, but I don't think that's an ideal solution. If we instead allow the user to optionally enable auto-detection, we can have built-in caching and detection for views that ensures views of the correct type are used at certain points in the render cycle.The text was updated successfully, but these errors were encountered: