Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Table header repeat problem
Dear all,
I’ve produced a form which takes some custom fields and displays them as a table. I have a head <code><th></code>, but it keeps appearing over each row of info:
<code>
<table>
<caption><txp:category1 /> | <txp:category2 /></caption>
<tr>
<th scope=“col” abbr=“Date” class=” “>Date</th>
<th scope=“col” abbr=“Versus”>Versus</th>
<th scope=“col” abbr=“Venue”>Venue</th>
<th scope=“col” abbr=“Score”>Score</th>
</tr>
<tr>
<td><txp:posted format=”%b %d, %Y” /></td>
<td><txp:custom_field name=“versus” /></td>
<td><txp:custom_field name=“home_or_away?” /></td>
<td><txp:custom_field name=“score” /></td>
</tr>
</table>
</code>
How can I stop this from happening, so it only appears once at the top of the table. Many thanks as always for your help.
Offline
Re: Table header repeat problem
Can you post the content of the form?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Table header repeat problem
Hi Colak,
Thanks for your reply. The code in my original message is the form –
<code>
<table>
<caption><txp:category1 /> | <txp:category2 /></caption>
<tr>
<th scope=“col” abbr=“Date” class=” “>Date</th>
<th scope=“col” abbr=“Versus”>Versus</th>
<th scope=“col” abbr=“Venue”>Venue</th>
<th scope=“col” abbr=“Score”>Score</th>
</tr>
<tr>
<td><txp:posted format=”%b %d, %Y” /></td>
<td><txp:custom_field name=“versus” /></td>
<td><txp:custom_field name=“home_or_away?” /></td>
<td><txp:custom_field name=“score” /></td>
</tr>
</table>
</code>
It’s then called-up within the page using –
<code>
<txp:article_custom form=“cltc_fixture_table”
category=“1st-Team” section=“juniors” time=“any”
sortby=“Posted” sortdir=“asc” />
<txp:else />
<txp:article form=“cltc_article_form” />
</txp:if_article_list>
</code>
Offline
#4 2006-08-07 14:39:17
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Table header repeat problem
In your page:
<txp:if_article_list>
<table>
<caption><txp:category1 /> | <txp:category2 /></caption>
<tr>
<th scope="col" abbr="Date">Date</th>
<th scope="col" abbr="Versus">Versus</th>
<th scope="col" abbr="Venue">Venue</th>
<th scope="col" abbr="Score">Score</th>
</tr>
<txp:article_custom section="juniors" category="1st-Team" time="any" sortby="Posted" sortdir="asc" form="cltc_fixture_table" />
</table>
<txp:else />
<txp:article form="cltc_article_form" />
</txp:if_article_list>
in your form:
<tr>
<td><txp:posted format="%b %d, %Y" /></td>
<td><txp:custom_field name="versus" /></td>
<td><txp:custom_field name="home_or_away?" /></td>
<td><txp:custom_field name="score" /></td>
</tr>
Now, I’m not sure what you’re expecting to happen there with:
<caption><txp:category1 /> | <txp:category2 /></caption>
Can you elaborate on what that’s supposed to function like?
Offline
Re: Table header repeat problem
Thanks so much Mary, your code works perfectly – I hadn’t thought of trying it that way!
The caption tag was suppose to output the cat 1 + 2 titles, being a tennis club site they refer to the various leagues, but I think I’m going to leave it out as content publishers won’t always categorise in the same order.
Once again, your response is very appreciated.
Offline
Re: Table header repeat problem
Hi,
Just one last question – if I want to list the leagues (eg Middlesex Summer League) on a section front page, which then links to the tables above , what would the best tag be? I can’t seem to get the <code><txp:if_article_list></code> to work for me.
Thanks.
Offline
#7 2006-08-08 23:42:53
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Table header repeat problem
What are you using for your section page at present? and what makes up each league? Is each an article or group of articles with a certain category, or something?
Offline
Re: Table header repeat problem
Hi Mary, thanks for your reply.
Section frontpages will list leagues that are structured using a combination of categories and sections.
There are Mens, Ladies and Junior teams (Sections) and then within these there are different standards called 1st, 2nd, 3rd and 4th teams (Categories). These teams then play various inter-club and internal Leagues (Categories), some overlap, some are particular to a certain team.
For example, if we take one of the Mens’ leagues – I would like to show a header (not necessarily a section or category title) for the Mens’ Middlesex Summer League Teams which links to the fixtures table (sub divided into 1st, 2nd, 3rd and 4th teams).
The data will be submitted by a variety of club members using articles – I’ve set-up custom fields for ‘versus’ (club we’re playing), ‘home_or_away’ and ‘score’. The publish date will be the date of the match. They then select the relevant section and categories.
Phew! Hope that makes sense.
Last edited by decoderltd (2006-08-09 09:39:06)
Offline
#9 2006-08-09 10:59:08
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Table header repeat problem
…not necessarily a section or category title…
Does that mean it won’t be (or that can be unreliable) or that it doesn’t have to be?
Woo, yeah I’m not sure I follow all of that. I think you’re stuck doing most of the page by hand, I’m afraid.
It sounds like you need glx_if_section_frontpage. You may also need chh_article_custom.
Offline
Re: Table header repeat problem
Hi Mary,
Sometimes the category and section names are fine for organising, but don’t always make inspiring or relevant headlines – so just wondered how to create a custom headline with a permalink that then used an article or list form in the usual way.
Thanks for the chh_article tip I’ve checked it out – it seems be extremely flexible and worth adding to my plug-ins.
Offline
Pages: 1