Well,
This sort of hacking isn’t technically supported (there once was a tutorial showing this type of module hacking but it’s gone now). BUT… it works none-the-less.
Try something like this in your Blog Post template:
{# Get 100 most recent posts... replace commas because it will break the comma-separated choice list #}
{% macro getBlogs() %}
{% set blog_list = blog_recent_posts('default', 100) %}
Most Recent,
{% for blog_post in blog_list %}
{% if loop.last %}
{{blog_post.name|replace(","," ")}}
{% else %}
{{blog_post.name|replace(","," ")}},
{%endif%}
{% endfor %}
{% endmacro %}
{# Get the blog post ID #}
{%- macro getBlogId(search) -%}
{% set blog_list = blog_recent_posts('default', 100) %}
{% set found = 0 %}
{% for blog_post in blog_list %}
{% if search|lower|urlencode == blog_post.name|replace(","," ")|lower|urlencode && found == 0 %}
{{blog_post.id}}
{% set found = 1 %}
{% else %}
{% endif %}
{% if (loop.last && found == 0) %}
{{blog_list[0].id }}
{% endif %}
{% endfor %}
{%- endmacro -%}
{% set postOptions = getBlogs() %}
{% choice "post_choice1" label='Choice 1', value='Most Recent', choices='{{postOptions}}' export_to_template_context=True %}
{% choice "post_choice2" label='Choice 2', value='Most Recent', choices='{{postOptions}}' export_to_template_context=True %}
{% choice "post_choice3" label='Choice 3', value='Most Recent', choices='{{postOptions}}' export_to_template_context=True %}
{% choice "post_choice4" label='Choice 4', value='Most Recent', choices='{{postOptions}}' export_to_template_context=True %}
{% set post1 = getBlogId(widget_data.post_choice1.value) %}
{% set post2 = getBlogId(widget_data.post_choice2.value) %}
{% set post3 = getBlogId(widget_data.post_choice3.value) %}
{% set post4 = getBlogId(widget_data.post_choice4.value) %}{% set choices = [post1,post2,post3,post4] %}
Basically what you get here is 4 drop-downs - each populated by a comma-separated list of recent post names.
You can then select one from the drop-down, and a separate function will populate variables with the blog post ID of those selections and put them in an array of IDs.
In an ideal world, just as @stefen mentioned, there’s a blog_post_by_id() function that takes the ID as a parameter (if only we could just plug these IDs in there!) and you can pump out posts from the ID.
Alas you cannot… believe me I’ve tried every manner of fiddling with that variable to get it to work in the function but it WON’T work. I’ve got other situations where variables work VERY well in this type of blog_post_by_id() context, but this is not one of them. If you were to add an ID directly (again as @stefen mentioned) this would work fine.
But to do it dynamically we need something else.
What you’ll have to do instead is wherever you want to put your related posts section / HubL For Loop, add something like this:
{% set recent_posts = blog_recent_posts('default', 100) %}
{% set found = 0 %}
{% for post in recent_posts %}
{% for choice in choices %}
{% if choice is string_containing post.id %}
{# INSERT YOUR HTML TO RENDER THE BLOG POST %}
{% endif %}
{% endfor %}
{% endfor %}
Give it a try and see if it works, I didn’t test the last bit (as my case only needed a single “featured post” so I just had 1 ID to look for (no second loop, just a simple {% if %} match case).
Good luck!