Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-03-31 14:39:19

Michael
Member
From: Vienna/Austria
Registered: 2004-03-25
Posts: 147
Website

..display the same article twice on an archive page?

Hi!

I use this code to get article-information and the article itself on my archive page (see this thread).

Now I have a problem: While the code <code><txp:article /></code> always shows the article that I called through the permalink on the archive page, this code <code><txp:article_custom form=“around_article” limit=“1” /></code> (in my sidebar) always shows me the most current article.

Check on this article!

Here’s the code:

<code>
<div id=“sidebar”> <h2>Around this article</h2>
<txp:article_custom form=“around_article” limit=“1” />
<txp:related_articles label=“Related Articles” limit=“10” break=“li” wraptag=“ul” /> </div> <div id=“content”> <txp:article /> </div>
</code>

How can I… make the article_custom display the same article as the txp:article?

Offline

#2 2005-03-31 20:24:27

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

Re: ..display the same article twice on an archive page?

Hang on a moment. This is for your article’s permalink/individual page? Then you customize the “default” article form, not use article_custom.

Using article_custom will return the latest post because you have to specifiy a section — article is section-context sensitive, article_custom is not.

Offline

#3 2005-04-01 08:15:55

Michael
Member
From: Vienna/Austria
Registered: 2004-03-25
Posts: 147
Website

Re: ..display the same article twice on an archive page?

I discovered this:

If you have an article without an excerpt, then you can use article and the special form (see here).

If you have an article with an excerpt, then, if you use this special form that does not display the articles body, you simply cannot change it: the body is being displayed.

For your viewing pleasure, check out:

Article with excerpt.
Article without.

Is this a bug?

Offline

#4 2005-04-04 14:37:05

Michael
Member
From: Vienna/Austria
Registered: 2004-03-25
Posts: 147
Website

Re: ..display the same article twice on an archive page?

Can I display an article without actually displaying its body?

Offline

#5 2005-04-04 15:28:46

davidm
Member
From: Paris, France
Registered: 2004-04-27
Posts: 719

Re: ..display the same article twice on an archive page?

Belethedheliel is right, you can call whatever you like. Me I call txp_article twice with two different form : I have the excerpt in one floating div and the body on the main div

<txp_article form="yourform" /> and you’re set :)

you can split your article in whatever part you need : title, posted, body, excerpt… great, uh ?


.: Retired :.

Offline

#6 2005-04-04 15:37:28

Michael
Member
From: Vienna/Austria
Registered: 2004-03-25
Posts: 147
Website

Re: ..display the same article twice on an archive page?

I am sorry to say, that it is not possible…

Look at this:

Here it works. (The article does not have an excerpt.

But here it does not work, because the article has an excerpt!!! Although I call the same form as in the first example, there is a difference!

And here it also does not work, because the article has been commented!!! In this case, too, I call the same form as in the first example!

Any ideas?

Last edited by Michael (2005-04-04 15:39:15)

Offline

#7 2005-04-04 16:04:21

Daragh
Member
From: Toronto Canada
Registered: 2004-05-26
Posts: 60
Website

Re: ..display the same article twice on an archive page?

It also doesn’t work for me. The second time I call txp:article, it outputs the article again, but using the form I specified in the first call. I’m not using an excerpt, but I’m using an override_form and various other bells and whistles.

Michael, you and I are trying to do the exact same thing: show article context on the sidebar of the page. I used to be able to do it by simply using article tags outside of a form, but not any more. It would be a shame if it were not possible in TXP for some reason.

Offline

#8 2005-04-04 16:17:35

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

Re: ..display the same article twice on an archive page?

Hmmm. Have you guys tried article_custom instead of article?

Offline

#9 2005-04-04 16:58:20

Daragh
Member
From: Toronto Canada
Registered: 2004-05-26
Posts: 60
Website

Re: ..display the same article twice on an archive page?

Yeah, and it displays the most recent article only.

Offline

#10 2005-04-04 17:34:05

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

Re: ..display the same article twice on an archive page?

Sorry, I keep forgetting article_custom isn’t context sensitive.

I can get my form to be used (with and without an excerpt and comments off/on) in the latest rev (260). Only, if commenting is turned on, then it also adds the comment form to it.

Edit: Never mind on the other thing I had posted here, I’m stupid.

Last edited by Mary (2005-04-04 17:37:23)

Offline

#11 2005-04-04 19:25:32

davidm
Member
From: Paris, France
Registered: 2004-04-27
Posts: 719

Re: ..display the same article twice on an archive page?

What exactly doesn’t work ?

I think you should post what’s inside your forms, because I simply don’t get why you should not be able to do what I did with <txp:article form="yourform"> calling different forms with different contents. (Do NOT use the override form option in the write tab though, or it will always call the one you specify in the override advanced options. LET IT BLANK).

In my case :

form1 :
I have <txp:excerpt />

I call it in my floating div :
<txp:article wraptag="p" form="form1" />

form2 :
I have <txp:body wraptag="p"/>

I call it in my main div :
<txp:article wraptag="p" form="form2" />

It’s a simple combination, because I didn’t need something more sophisticated, but I don’t see why it shouldn’t work.

Last edited by davidm (2005-04-04 19:27:12)


.: Retired :.

Offline

Board footer

Powered by FluxBB