Hi you guys.
So I was learning how to customize Plone on https://training.plone.org/5/mastering-plone/zpt_2.html? and tried to follow the tutorial on adding the publishing date to my NewsItem posts. I've also tried to spice it up a bit and add a tiny icon to the side of the date.
Thing is, whenever I click on a news post I get the date it was posted on, but if I refresh the page, it simply disappears. It also happens if I go from one news post to another one. It will display on the first one I open, but if I come back and try another news page it won't display the publishing date (it does if you just refresh the page).
Here's the code I'm using :
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="plone">
<metal:content-core fill-slot="content-core">
<metal:content-core define-macro="content-core"
tal:define="toc context/table_of_contents|nothing;">
<p>
<i class="glyphicon glyphicon-calendar" />
${python: plone_view.toLocalizedTime(context.Date(),long_format=1)}
</p>
<div id="parent-fieldname-text"
tal:condition="context/text"
tal:content="structure python:context.text.output_relative_to(view.context)"
tal:attributes="class python: toc and 'pat-autotoc' or ''" />
</metal:content-core>
</metal:content-core>
</body>
</html>
Many thanks in advance!
Best regards,
Thiago