Forum

Thread tagged as: Question

Time element - blog app

Hi,

I am wondering if following code:

<time class="dt-published" datetime="<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Meta information" />">
            <perch:blog id="postDateTime" type="date" time="true" format="%d %B %Y" /> 
        </time>

is actually necessary and is there any detriment to its' removal.

Thanks for any advice

Garth Holmes

Garth Holmes 1 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You need a postDateTime field in your post.html template because it's a blog and blog posts have to have a date. (Else they're not really blog posts and you're using the wrong tool.)

If you don't want to output the date, that's fine. Use:

 <perch:blog id="postDateTime" type="date" time="true" suppress="true" />

You don't need to include it in any of your other templates - just the master template.

Hi Drew,

I suppose I really meant the <time></time> element as opposed to <perch:blog/> so I removed the '<time></time> element and nothing is missing.

Thanks