omeka / omeka-s

Omeka S is a web publication system for universities, galleries, libraries, archives, and museums. It consists of a local network of independently curated exhibits sharing a collaboratively built pool of items, media, and their metadata.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

zerocrates opened this issue · comments

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.