Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-27 07:19:58

bokane
Member
From: Beijing, China
Registered: 2005-10-24
Posts: 13
Website

Forms repeating?

Hey –

I’ve been trying to set up forms to handle chunks of code — both HTML code and stuff that requires the intervention of Textpattern.

In every case, though, the form ends up repeating multiple times. I’ve got one bit of code that does nothing but draw a divider table between posts, and doesn’t rely on any conditionals or do anything else particuarly loopy, but instead of going

[article]
[divider]
[article], it ends up more like

[article]
[divider]
[divider]
[divider]
[divider]
[divider]
[article].

The code that’s doing this is just (p class=“articletitle”>(a name=”(txp:title />”>(txp:title />(/p>(/a>(/span>(h3 class=“articleinfo”>(txp:rei_show_custom customid=“1” />, (txp:rei_show_custom customid=“3” />(/h3>
(txp:body />
(txp:article_custom form=“telecom_divider” />, where the “telecom_divider” snippet is just code for a table.

I’m sure this is really simple and I’m just missing something totally obvious, but it’s been vexing me sore for the past couple of hours. Any help would be much appreciated.

Offline

#2 2005-12-27 09:02:34

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

Re: Forms repeating?

If “telecom_divider” is not an article form, you’ll have to use txp:output_form:
<code>
<p class=“articletitle”><a name=”<txp:title />”><txp:title /></a></p>
<h3 class=“articleinfo”><txp:rei_show_custom customid=“1” />, <txp:rei_show_custom customid=“3” /></h3>
<txp:body />
<txp:output_form form=“telecom_divider” /></code> (or directly enter the snippet of code here)

This will also output the divider after the last article in the list. If you don’t want that, use txp:if_last_article, so instead of the last line:
<code>
<txp:if_last_article></code> (output nothing)
<code><txp:else />
<txp:output_form form=“telecom_divider” />
</txp:if_last_article>
</code>
Instead of rei_show_custom you could use txp:custom_field.

EDIT: You can display code here with < code > < /code > tags (without the spaces).

Last edited by doggiez (2005-12-27 09:03:48)

Offline

#3 2005-12-27 09:04:58

bokane
Member
From: Beijing, China
Registered: 2005-10-24
Posts: 13
Website

Re: Forms repeating?

Thanks – most stuff is working now, though there’s still some unrelated code that isn’t behaving quite as I’d expect. I’m in a much, much better mood now.

Thanks!

Offline

Board footer

Powered by FluxBB