Date curlybars formatting
AnsweredI am trying to output the article.created_at on our homepage template. According to the docs https://developer.zendesk.com/apps/docs/help-center-templates/helpers#date-helper `date` is a global helper that should be accessible from the homepage template.
Any of the examples shown in the docs cause a syntax error "Unable to preview 'Home page' due to invalid reference: {{article.created_at}} at line 80"
I can get {{created_at}} to render, however I don't seem to have access to the format property.
Here is what that section of the page looks like:
{{#each sections}}
<ul class="news-and-updates-list d-f fw-w">
{{#each articles}}
<li>
<a href="{{url}}">{{title}}</a>
<span class="meta color--quiet">{{created_at }}</span>
</li>
{{/each}}
</ul>
{{/each}}
-
Hi Shane -
Sorry for the confusion here! I have been doing some testing in the homepage template and using the following format -<span>{{date created_at class='metadata' format='short'}}</span>
I was able to get the dates to display as expected:
Let me know how things look on your end!
Please sign in to leave a comment.
1 Comments