Pulling up a specific post, use data in a "template"

It would be nice to be able to pull up a specific post to display somewhere using a “template”, not a full template, but just something defined in config like all the other templates for posts where the metadata could be used.

Specifically I want to create a “featured post” template, but I could see many uses for this. For now, I’m creating an advanced variable that I can pass through three or four pieces of data, but it is manual, I have to grab the location/URL, the title, etc. I’d like to be able to do something like {featured-post:<ID>} where “featured post” is defined like:

Featured post: <<[---
<article>
  <h3>$title</h3>
  ...
  ...
</article>
]>>

And the post ID would ensure all the variables in that template grab the correct post data. Of course, this would mean we would need the post ID available in the admin UI, which I don’t think it currently is.

I see this request a bit like a view layer, in Drupal we could have any number of different “views” of a “node” (the generic term for an post entity) or other entity. A common one would be the “teaser” that would grab the summary, image, title, URL, etc, all definable via a template for function.

1 Like

This is a very cool idea. I’ll start working on it!