Hi there,
I’m using a custom HTML template for listing all posts from all of the blogs.
The below is an example of how the template starts, based on the information found here Blog templates - HubSpot docs
{% set all_posts = [] %}
{% set press_posts = blog_recent_posts('1', 200) %}
{% set blog_posts = blog_recent_posts('2', 200) %}
{% set case_study_posts = blog_recent_posts('3', 200) %}
{% set insight_posts = blog_recent_posts('4', 200) %}
{% set research_posts = blog_recent_posts('5', 200) %}
{% set video_posts = blog_recent_posts('6', 200) %}
And the filter looks like this:
<div class="col is-6 is-4-md">
<span class="input-label">Filter by type:</span>
<select id="js-type-filter" class="category-filter">
<option value="all" selected="">Select type</option>
<option value="type-press-releases">Press releases</option>
<option value="type-blogs">Blogs</option>
<option value="type-research">Research and Insights</option>
<option value="type-video">Video</option>
</select>
</div>
The template works just fine, but the issue is that no-one other than me can edit the filter.
I’m trying to figure out how to allow someone editing the listing page to change the options in the drop-down and for it to still work. I expect that this isn’t easily done without a workaround if it’s even possible. Does anyone have any ideas?
My idea is to use a custom module that would have a blog_id repeatable field and make it into something that would look a bit like this:
{% choice "blog_id" label='Choose the Blog ID', value='Text', choices='1, 2, 3, 4, 5', export_to_template_context=True %}
{% for choice in choices %}
{% set blog_name = blog_recent_posts(blog_id, 200) %}
---
<option value="{{ blog_id }}">Press releases</option>
But I can’t make the choice module editable from within the page editor.
Thanks
