I'd like to embed this page as an iframe in my blog post content, but I want it to show up before the flip in the generic 'blog' page, ie showing the N most recent posts.
If someone clicks through, I can show them the iframe by editing the template for that particular blog post - but for the most recent blog posts page, the iframe needs to come out of post.blog_post.content but the HTML editor consumes it.
I thought about editing the overall blog template to look at the tag of each post, and use a special tag to know to show the extended version in the list, but I can't think of where I'd put the URL of the iframe I want to show, unless I hijack another tag and use the tag.name field to hold it.
I think it'd be really nice to be able to tell the editor to not strip the iframe, and to just trust me when I tell it I know what I'm doing.
Please see our documentation on calling a blog to another page.
Showing 3 reactions
Sign in with
What I’m doing is using tags as ht-key-value (ht stands for “hack tags”). I changed theme-wide _page_tags.html to ignore tags that start with ht-:
{% if page_tags.tags_count > 0 }
<div class=“padbottom”>
<div class=“page_tag_background”>
{ for tag in page_tags.tags }
{ unless tag.name contains “ht-” }
<span class=“page_tag”><a href=“{{ tag.url }}”>{{ tag.name }}</a></span>
{ endunless }
{ endfor }
</div>
</div>
{ endif %}
and then, for my “Endorsed Candidate” blog, on each candidate post I tagged them as ‘ht-office-District 1’ and ‘ht-office-District 2’, etc. When you look at the post, that tag no longer shows up.
On the blog post listings page, I added some code to the template (only for that page, not the theme-wide template):
{% for post in page.blog.most_recent_blog_posts %}
<div class=“page_excerpt padbottom” id=“blog_post_page_{{ post.id }}”>
<h3><a href=“{{ post.url }}”>{{ post.headline }}</a></h3> {% if post.tags_count > 0 %}
{% for tag in post.tags }
{ if tag.name contains “ht-office” }
<h3>{{tag.name | split:“-” | last}}</h3>
{ endif }
{ endfor }
{ endif %}
It’s a little wonky, but it’s a start.