Forum
Categories outside the paragraph
I'm trying to create the following:
A paragraph with a time element and a listing of categories.
I have the following template set:
<p class="meta">
<time class="dt-published" datetime="<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Publishing" />">
<perch:blog id="postDateTime" type="date" time="true" format="%d %B %Y" />
</time>
<perch:categories id="categories" set="blog" label="Categories">
<perch:before>
<ul class="post__cat">
</perch:before>
<li class="post__cat__item">
<a href="/blog/archives/<perch:category id="catSlug" type="slug" />" class="p-category post__link"><perch:category id="catTitle" type="text" /></a>
</li>
<perch:after>
</ul>
</perch:after>
</perch:categories>
</p>
Perch has generated as followed:
<p class="meta">
<time class="dt-published" datetime="2015-11-09 21:48:00">
09 November 2015
</time>
</p>
<ul class="post__cat">
<li class="post__cat__item">
<a href="/blog/archives/links" class="p-category post__link">Links</a>
</li>
<li class="post__cat__item">
<a href="/blog/archives/review" class="p-category post__link">Review</a>
</li>
</ul>
<p></p>
Am I doing it wrong?
Hi, I think Perch is outputting:
'View Page Source' should confirm that.
But a browser will try to validate the code by closing the <p> before opening the <ul>. Showing this if you 'Inspect element' (not View Source)...
I think that's the case.
I agree with Simon.
Doh! OK, never mind.