I've written too many alter hooks to get rid of this, so here's a patch to add it as a formatter setting.
The main thing the argument does is control the h2 title in the default entity template, in a lot of cases, that doesn't make and hiding it in a different way requires either custom code or something like Display Suite, which again afaik only works for entities that have an exposed manage display page. I have a whole set of remote entities which are not fieldable and frequently embedded into pages using entity reference.
Not sure if this needs an upgrade path, we could also just make the check conditional :)
Patch coming soon.
Comments
Comment #1
BerdirHere's a patch, is working nicely for me. Not sure about summary (there's only so much space to show something) and the description that I added. Hard to find a mix of useful information and obvious information as that can of course be said about most settings. But I think it makes sense here as that setting will not do anything for DS'ified entities...
Comment #2
BerdirDid a !empty() check in formatter_view() so that doesn't result in a notice if not set but just noticed that I forgot to do that in the settings form.
Comment #3
BerdirUpdated that check to use !empty() as well.
Comment #4
BerdirActually the setting is the wrong way round.
Comment #5
amateescu CreditAttribution: amateescu commentedHm, this comment is a bit superfluous.. anything can be overridden :/ Otherwise, this looks good to me.
Comment #6
BerdirYes, I wasn't sure about that either. But most other settings at least require code to override it. This is different, using something like panelizer or DS is enough to completely bypass the setting, it only works with the default templates.
Comment #7
BerdirRe-roll, context changed a bit, removed the message. The old patch still applies if you use git apply -3, so it's up to you which one you prefer :)
Comment #8
BerdirAnother reroll.
Comment #10
BerdirThat's a problem with views, unrelated to the patch: #2866162: Plan for Views 7.x-3.18 release, #2903006: Fix tests for 7.x-3.x