New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: automatic view type detection #889
Labels
Comments
@jonschlinkert Thanks for the issue! If you're reporting a bug, please be sure to include:
If your issue is related to one of the following, please open an issue there:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: