Reputation: 15
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
{% set effective_date = module.show_custom_update_date ? module.updated_date : content.publish_date %}
{% set module.sort_date = effective_date %}
<p>Sort Date: {{module.sort_date}}</p>
<div class="article-heading-banner">
<h1 class="article-title">{{content.title}}</h1>
<p class="article-details"><a href="{{ blog_author_url(group.id, content.blog_post_author.slug) }}">{{ content.blog_post_author.display_name }}</a> | Published {{ content.publish_date | format_date('MMMM dd, yyyy') }}
{% if module.show_custom_update_date %}
{% set update_time = content.updated %}
| Updated {{ module.updated_date | format_date('MMMM dd, yyyy') }}
{% endif %}
</p>
</div>
I have tried this on the post page template. I see no data on sort_date when viewing the developer info json of the post. How can I set this via Hubl.
I am expecting to pass date on the the sort_date module.
What is the best way to achieve custom sorting for the index page?
Upvotes: 0
Views: 43