-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
[RFE] Viewless content types #2149
Comments
This has been on my wish list forever. I currently have hackish workarounds for it, but something simple and formal would be awesome! |
+1 and other +1 for template:=null |
I actually like the simplicity of setting the template to null but then I guess that can be a bit magic in that it does much more than just not have a template. So my vote would be for an explicit setting (although by convention it might be nice to set the template to null too) not sure the best name for it, viewless and viewable seem a bit awkward. |
Same as @GawainLynch . I usually call them Blocks, then use |
@rossriley that was pretty much exactly my line of thought - template = null is elegant but magical, viewless = true is obvious but redundant. |
👍 for |
... and what happens if dummy user conf like this? ...
template: list.twig
.. bla-bla ...
viewless: true
... Just because a contenttype record can be long enough and could be long distance between that rows to be able realize easily what's the problem with. |
I would expect |
👍 |
@GawainLynch it is of course. I was just meant about "Why my template doesn't gets run?" situations. |
Thinking out loud, but there is an updated logging system that will hit the ground circa 2.1 and one thing I want to do it look at what we're logging and how that is relayed to the site admins... Maybe this is just something we can log? |
@GawainLynch that's fine I think. Entry in log something like this |
Works for me |
Well, that question would rather surface as "why does my content not show up at all?" In that context, maybe it would be somewhat confusing to see the route disappear when you set the template to |
Ok, we will make it |
🍻 |
Proposal: add a property
viewless
tocontenttypes.yml
(or, alternatively, allow explicitly setting thetemplate
properties tonull
- discuss!), which indicates that:The purpose of such contenttypes is to provide manageable "auxiliary" content that can be referenced from other content records and templates (either through
getContent
/{% setcontent %}
, or by means of Relationships), but doesn't make sense on its own. Popular examples include snippets of information that you may want to share between proper content records, but that don't deserve frontend pages of their own, such as contact addresses, content blocks for headers and footers, etc.Technically, all that is required to do this is add the property, and check it in a few strategic places to block the things listed above.
Regarding naming, I propose the term viewless contenttypes; suggestions for a better name are extremely welcome.
The text was updated successfully, but these errors were encountered: