Log in Sign up

Insert block in page

I’m looking to avoid repeating a specific block of code from within the individual post entries. Within a theme, this would be achieved using {{> Block}}.

Is there a way to do this within a post. Currently Blot hides this code. Do I need to put a path? {{> /templates/theme-name/Block }} or something similar?


3 years ago, 3 replies   Edit question

This would be useful to me as well.

Answered 3 years ago · Edit answer

This is not possible at the moment – right now, entries are treated as static and are not evaluated dynamically like template views. Can I ask what you're trying to repeat more specifically?

If you want to add something either before or after some set of posts, you could use custom metadata like so in your post:

preamble: yes

And like so in your template's entry.html file:

{{#entry}}
{{#metadata.preamble}}
<p>This content will be repeated/shown for all posts with the preable metadata.</p>
{{/metadata.preamble}}

{{{html}}}

...
{{/entry}}
Answered 3 years ago · Edit answer

Not the OP.

The way this would be useful for me is to have something like a php include. In my case, I have a listing of faculty contact info that is used at various places in the site. It would be nice to do something like include("faculty-contact.txt").

Answered 3 years ago · Edit answer