Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-23 18:10:15

parlour
Member
From: Germany
Registered: 2006-09-01
Posts: 20

Display Article Lists with Headlines for Every Month

When a certain category is selected I display the respective article titles in a unordered list with headlines for every month. Like this (that’s the form):

<txp:if_different>
</ul>
<h1><txp:posted format="%B %G" /></h1>
<ul>
</txp:if_different>
<li><txp:title /></li>
<txp:if_last_article>
</ul>
</txp:if_last_article>

This works fine. The problem is the first </ul> after the <txp:if_different>.

It is obviously also inserted before there is even a list this tag could close. So I have a stray </ul> tag in my html page. And I would like to get rid of it. I tried to solve this problem with <txp:if_first_article> but that just breaks <txp:if_different>.

Offline

#2 2009-08-23 18:21:43

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Display Article Lists with Headlines for Every Month

Hi Parlour can you post the who;e form as what you post above is definitely not right.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2009-08-23 18:23:54

parlour
Member
From: Germany
Registered: 2006-09-01
Posts: 20

Re: Display Article Lists with Headlines for Every Month

I thought I stripped it only of nonessential stuff. This is the whole original form and it works:

<txp:if_first_article><div id="spalte2">
<h1 class="spalte">Übersicht</h1></txp:if_first_article>
<txp:if_different></ul>
<h4><txp:posted format="%B %G" /></h4>
<ul></txp:if_different>
<li><a href="#<txp:article_id />"><txp:title /></a></li>
<txp:if_last_article></ul>
</div></txp:if_last_article>

Offline

#4 2009-08-23 19:35:52

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Display Article Lists with Headlines for Every Month

parlour wrote:

So I have a stray </ul> tag in my html page. And I would like to get rid of it.

It’s a problem with lists and if_different that can only be solved by a workaround:

<txp:if_first_article><div id="spalte2">
<h1 class="spalte">Übersicht</h1>
<ul style="display:none;"></txp:if_first_article>
<txp:if_different></ul>
<h4><txp:posted format="%B %G" /></h4>
<ul></txp:if_different>
<li><a href="#<txp:article_id />"><txp:title /></a></li>
<txp:if_last_article></ul>
</div></txp:if_last_article>

Offline

Board footer

Powered by FluxBB