Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-04 10:30:07

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Captions for Article Lists

I am trying to put a caption under each article title using custom fields but so far have not been able to figure it out.

Right now I have a custom field called “Caption” where I enter the relevant text for each article.
I would like my parsed html to look like this:

<code>
<ul>
<li>Item 1 <br />
Caption 1</li>
<li>Item 2 <br />
Caption 2</li>
<li>Item 3 <br />
Caption 3</li>
</ul>
</code>

I haven’t the slightest idea how to tackle this one…

Last edited by Ace of Dubs (2006-07-04 10:30:31)

Offline

#2 2006-07-04 12:42:58

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Captions for Article Lists

Offline

#3 2006-07-04 15:27:01

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

Re: Captions for Article Lists

Article form:
<code><li><txp:title /><br />
<txp:custom_field name=“Caption” /></li>
</code>
Article tag:
<ul><txp:article listform="the-above-form" /></ul>

Offline

#4 2006-07-04 17:06:07

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: Captions for Article Lists

My apologies…I wasnt very clear with my intention. What I am looking for is a list of links to articles that will be dynamically updated whenever content is added.

This is more like it…

<code><ul>
<li><a href=“recent_article1”>Recent Article 1</a><br />
Descriptive Caption 1</li>
<li><a href=“recent_article2”>Recent Article 2</a><br />
Descriptive Caption 2</li>
<li><a href=“recent_article3”>Recent Article 31</a><br />
Descriptive Caption 3</li>
</ul></code>

Offline

#5 2006-07-04 17:42:50

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Captions for Article Lists

Use the article tag and a form. Use the excerpt field as your caption field.

Offline

#6 2006-07-05 17:28:41

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: Captions for Article Lists

Thanks alot yall. Between your advice and Els I finally got the desired result.

Since I am already using excerpts, my only solution was custom fields, which I have used not only to make captions but also to assign various images to articles, navigation elements and headers without my client having to touch a line of code. Just one entry into the custom field and PRESTO everything shows up the way it should.

I think I’m in love!

Last edited by Ace of Dubs (2006-07-05 17:30:07)

Offline

Board footer

Powered by FluxBB