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

EXPOSE_BLOCKS not documented #214

Open
johnhorner opened this issue Apr 19, 2019 · 2 comments
Open

EXPOSE_BLOCKS not documented #214

johnhorner opened this issue Apr 19, 2019 · 2 comments

Comments

@johnhorner
Copy link

It doesn't appear that EXPOSE_BLOCKS is documented anywhere on the http://www.template-toolkit.org/ site. The only place to find out about it is in the O'Reilly book.

@toddr
Copy link
Collaborator

toddr commented Apr 19, 2019

Ok do you want to give us a summary of what you now understand? Or maybe a patch?

@johnhorner
Copy link
Author

I guess I would add to this page:

http://www.template-toolkit.org/docs/manual/Config.html

In this section:

http://www.template-toolkit.org/docs/manual/Config.html#section_Template_Files_and_Blocks

something like:

Normally a block is only processed as part of the template in which it's contained. The expose_blocks option allows you to process a block in isolation, using the following syntax:

[% PROCESS <templatename>/<blockname> %]
 
For example if you had a navbar block defined in your header.tt and wanted to render the same navbar in some other context without the surrounding header code, you could use expose_blocks and then

[% PROCESS header/navbar %]

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