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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing a template name to the BlockLayout view helper's render() #2184

Closed
zerocrates opened this issue Apr 12, 2024 · 0 comments · Fixed by #2186
Closed

Allow passing a template name to the BlockLayout view helper's render() #2184

zerocrates opened this issue Apr 12, 2024 · 0 comments · Fixed by #2186
Assignees

Comments

@zerocrates
Copy link
Member

We provide several other ways of using custom templates, most obviously the block template system, but a theme using a page template might want to render some blocks with a changed template in the context of that page

That's currently not particularly simple for a theme writer to do: it involves either duplicating the render code of the block or getting the actual block layout object to call its render (which does let you pass a template).

render() in the helper is already handling templates for the block template feature and so has the basic structure already of passing a template to the block layout's render() when necessary. This could be as simple as removing the explicit initialization to null here https://github.com/omeka/omeka-s/blob/develop/application/src/View/Helper/BlockLayout.php#L140 and instead introducing a null-default argument to the method.

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

Successfully merging a pull request may close this issue.

3 participants