Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
wrapping article in li not working correctly
Hello people,
Im trying to get my articles wrapped in list tags on my excerpt page. Ive done it like this with my form and in the source it does indeed show ,within an unordered list, each article wrapped in a opeing and closing list tag.
The problem is im applying a bottom border to the li item and for some reason it only covers the article text and not the read on and comments links below. In the parsed source these are also wrapped in the li tag though.
heres the form:
<code>
<li><txp:if_article_list>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<p class=“info”><txp:posted /> by <txp:author /></p>
<txp:wet_article_thumb link=“0” />
<txp:excerpt />
<txp:if_comments>
<p class=“read”><txp:permlink>read on…</txp:permlink></p>
<p class=“comments”><a href=”<txp:permlink />#discuss” >comment (<txp:comments_count />)</a></p>
<txp:else />
<txp:if_comments_allowed><p class=“read”><txp:permlink>read on…</txp:permlink></p>
<p class=“comments”><a href=”<txp:permlink />#discuss”>comment (<txp:comments_count /> )</a></p></li>
<txp:else /></txp:if_comments_allowed>
</txp:if_comments>
</txp:if_article_list>
<txp:if_individual_article>
<h3><txp:title /></h3>
<p class=“info”><txp:posted /> by <txp:author /></p>
<txp:article_image />
<txp:body />
<txp:if_comments>
</txp:if_comments>
</txp:if_individual_article>
</code>
My url is the one in my signiature. I cant work it out can anyone else?
Offline
#2 2006-10-05 22:54:34
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: wrapping article in li not working correctly
I don’t know if this is causing your problem, but the closing </li>
is inside a conditional tag. Looking at the source, your second article doesn’t have a closing </li>
. If you move it to after </txp:if_comments>
at least it will always show. Also, you can drop the second <txp:else />
tag, it doesn’t do anything.
Edit: also move the first <li>
to after <txp:if_article_list>
Last edited by els (2006-10-05 22:59:06)
Offline
#3 2006-10-06 01:47:35
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: wrapping article in li not working correctly
You should be putting the conditional on your page, not in your form, otherwise it can get too confusing.
page:
<txp:if_article_list>
<ul>
<txp:article form="list" />
</ul>
<txp:else />
<txp:article form="individual" />
</txp:if_article_list>
list
<li><h3><txp:permlink><txp:title /></txp:permlink></h3>
<p class="info"><txp:posted /> by <txp:author /></p>
<p><txp:wet_article_thumb link="0" /></p>
<txp:excerpt />
<txp:if_comments>
<p class="read"><txp:permlink>read on...</txp:permlink></p>
<p class="comments"><a href="<txp:permlink />#discuss">comment (<txp:comments_count />)</a></p>
<txp:else />
<txp:if_comments_allowed>
<p class="read"><txp:permlink>read on...</txp:permlink></p>
<p class="comments"><a href="<txp:permlink />#discuss">comment</a></p>
</txp:if_comments_allowed>
</txp:if_comments></li>
individual
<h3><txp:title /></h3>
<p class="info"><txp:posted /> by <txp:author /></p>
<p><txp:article_image /></p>
<txp:body />
Get the idea?
Offline