Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the entity to the page header template and bundle template suggestions to page header block #194

Open
andybroomfield opened this issue Nov 18, 2023 · 1 comment

Comments

@andybroomfield
Copy link
Contributor

andybroomfield commented Nov 18, 2023

Coming over from the PR 133 on localgov_guides.

I like this (though I would quibble pointlessly about that subtitle markup 馃榾). I have two additional suggestions:

  1. add another variable, node, to the module's hook_theme implementation for this block, then populate it with the node object. This will make it simple, in themes, to override the rendering of the block according to content type (and according to the node content itself),
  2. add template suggestions for the content type to the block template (maybe using EntityTypeBundleInfo() in hook_theme_suggestions_HOOK()...not sure if we would want to limit this to LGD content types, or just catch them all),

The fact that what might be relatively simple things to handle in themes spawn issues like consider stacked h1 pattern for guides, and that (as you pointed out) localgov_publications uses a different block suggest to me that the core block could be more helpful specifically w/r/t the current content type.

Originally posted by @ctorgalson in #193 (comment)

As it can be used on any entity, perhaps entity type and bundle type.
The entity is already part of the block so can be added to the template.

@rupertj
Copy link
Member

rupertj commented Nov 20, 2023

I'd be well in favour of this. I'm pretty sure it'd let us get rid of the header block that localgov_publications has in favour of just using the existing one with a template and some preprocess. It'd also simplify some of the theme work we've done on H&F.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants