I need to use a custom update date for a blog post and use it for sorting in the list/index page .
I have 3 fields 1. show_custom_update_date toggle to show custom update date on a post. 2. updated_date is for the custom date if enabled. 3. sort_date is to pass the variable data to a module.
@FMesina - Based on your description, my guess here is that to set the custom data on each plog post you will need to use "export to template context" logic on the blog post. A recent write of of this is here:
@FMesina - the convention for references to the 'template context' variables is different in the blog listing template from that in the blog post template. I also see you have a module reference that I think is redundant.
Once you have a subset of posts you wish to list - in sorted format ideally, you will be able to work with teh extra data field as follows:
Hope that helps,
{% for post in sorted %}
{% set extra_date = post.widgets.extra_date.body.date_choice %}
...
Anything that starts with "module." is coming from the inputs of the module and cannot be changed by HubL. In order for that line to work, it would need to be a simple variable.
{% set custom_sort_date = effective_date %}
<p>Sort Date: {{custom_sort_date}}</p>
If you want to pull data from the module into the blog listing page, I believe it will only allow pulling the input values (that start with "module", not the variables).
Assuming you want to pull the value for "updated_date", your code in the listing template would look something like this:
@FMesina - Based on your description, my guess here is that to set the custom data on each plog post you will need to use "export to template context" logic on the blog post. A recent write of of this is here: