Allow use of hook_entity_view, so we can add content to the rendered atom.
eg I'll use this to add comments to the atom's page.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | scald-hook_entity_view-2266935-4.patch | 1.13 KB | davidhk |
| #1 | scald-hook_entity_view-2266935-1.patch | 701 bytes | davidhk |
Comments
Comment #1
davidhk commentedComment #2
dave reidIf you're going to invoke hook_entity_view(), you should also be invoking hook_ENTITY_TYPE_view(), hook_entity_view_alter() and hook_ENTITY_TYPE_view_alter() as per entity rendering standards and expectations.
Comment #3
jcisio commentedYes #2 sounds good. Examples are in node_view() and node_build_content().
#2089865: Entity API as dependency (was Rules integration for atom CRUD events) will simplify a lot of duplicate code.
Comment #4
davidhk commentedI've edited scald_atom_view() and scald_atom_build_content() to add in the hooks, using node_view() and node_build_content() as templates.
The exception is that node_build_content() has the lines:
I'm not sure if Scald has any equivalent so I have not added them.
Comment #5
jcisio commentedYes, it is equivalent to Scald prerender callbacks, so you don't have to add them.
Comment #7
jcisio commentedAdded two hook_ENTITY_TYPE_view(_alter) hooks and committed. Thanks!