Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-05 19:50:04

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

What is the point of "article" and "article_custom?"

I like TXP very much, but I find using two different article tags seems like unnecessary complexity. For instance, all I want to do is this:

<div id="foo">
<txp:article form="full" listform="list" category="foo" sortdir="asc" />
</div>
<div id="bar">
<txp:article form="full" listform="list" category="bar" sortdir="asc" />
</div>

Except I can’t because the “section” attribute is not supported. And I can’t use article_custom for this since listform is no longer supported! Would it not make more sense if there was just one article tag with all available attributes than gumming up the simplicity of TXP with two sort-of-but-not-really-the-same-thing tags. Why use a bunch of conditional tags to accomplish something so simple?

And if anyone could tell me how to structure my markup to accomplish my example above, I would be in your debt.


Kevin
(graphicpush)

Offline

#2 2005-11-05 20:36:12

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: What is the point of "article" and "article_custom?"

And if anyone could tell me how to structure my markup to accomplish my example above, I would be in your debt.

The sticky: What’s this forum for? Please read before posting says: This forum isn’t for asking How do I…?

—-> Moving to “How do I?”.

To answer your question: I just tried and listform is working with article-custom (4.0.2).

> What is the point of “article” and “article_custom?”

article is context-sensitive, article_custom is not. Context-sensitive means, that it will adapt to the url-parameters (think about section, category, pagenumber, search, etc. etc.); whereas the other one will show exactly that which you specify it to show.

Offline

#3 2005-11-05 20:40:04

aesop1
Archived Plugin Author
Registered: 2004-09-19
Posts: 142

Re: What is the point of "article" and "article_custom?"

<code>
<txp:if_article_list> <txp:article_custom section=“foo” form=“list” category=“bar” sortdir=“asc” />
</txp:if_article_list>
<txp:if_individual_article> <txp:article />
</txp:if_individual_article>
</code>

Of course you would need to call article_custom like this for each section (or category) you want included. Update: but only one call to <code><txp:article /></code> is necessary.

Last edited by aesop1 (2005-11-05 21:41:42)

Offline

#4 2005-11-05 20:53:43

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: What is the point of "article" and "article_custom?"

Hi kevinpotts.

First, what are you trying to achieve? Maybe, I’m loosing something from your post, but by looking at the code you posted, the only thing I can figure you want to achieve is to show an article list or an individual article, context-sensitive (I mean, sensible to the URL).

But then you add: <blockquote>Except I can’t because the “section” attribute is not supported.</blockquote>

Then, the ontly thing I can suppose is that you want to show an article list from another section, and not from the section you are standing at.
In this case, you need to use txp:article_custom.
Also, I must suppose that if you are in section X and you want to show a list of articles from section Y, what you really want is to show an article list of articles in section Y, and not the full article.

So, you dont need a “listform” attributte, because article_custom is mostly for create article list. And it supports “form” attribute, you should create a form to use with txp:article_custom, and include in that form only the article tags you want to show in the list (txp:body, txp:title, etc).

Second, if I’m not very clear, I have no-doubt that by reading the FAQs, you will get a better idea:

Finally, Tag Examples forum is for posting tag examples that actually work for you. It’s for share your tips and tricks about how to use and combine tags.
In my opinion, your post is more a “How do I…?” forum question.

So, “How do I…?” is where this thread should belong to.

EDIT: while I was writing this post, Sencer and aesop1 posted their thoughs before, and I didnt notice that.

Last edited by maniqui (2005-11-05 21:01:04)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2005-11-05 20:58:40

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: What is the point of "article" and "article_custom?"

Sencer wrote: <blockquote>To answer your question: I just tried and listform is working with article-custom (4.0.2).</blockquote>

Cool. edit: Cool? or this just add confusion?
So, the TextBook should be updated in the Txp:article_custom entry, because it actually says:

<blockquote>The attribute listform no longer exists for article_custom (only, it still exists for article). Instead, make use of conditional tags.</blockquote>

Last edited by maniqui (2005-11-05 21:18:47)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2005-11-05 21:05:33

aesop1
Archived Plugin Author
Registered: 2004-09-19
Posts: 142

Re: What is the point of "article" and "article_custom?"

Can’t “form” also be used in list context with article_custom? I thought that was the point of deprecating listform (if that ever occurred): because it was simply unnecessary.

Last edited by aesop1 (2005-11-05 21:05:58)

Offline

#7 2005-11-05 21:26:26

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: What is the point of "article" and "article_custom?"

We are saying that txp:article_custom is not context-sensitive, at least, in relation to the section we are currently viewing.

But, is article_custom sensitive to article_list/individual_article context?

I would say that is not sensitive to article_list/individual_article.
So, in this case, to have both form/listform attributes would be unnecesary.

Also, it seems to be hard to find an example where someone wants to use article_custom to diplay the same list in two different ways (ie. with two different forms) if in article_list context and if in individual_article context.

Last edited by maniqui (2005-11-05 21:29:52)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2005-11-05 21:40:40

aesop1
Archived Plugin Author
Registered: 2004-09-19
Posts: 142

Re: What is the point of "article" and "article_custom?"

Maniqui — You are right and I believe we are saying the same thing.

Otherwise, <code><txp:if_article_list></code> would be unnecessary in the context I used it in the example above.

Offline

#9 2005-11-06 01:34:52

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

Re: What is the point of "article" and "article_custom?"

article_custom is not context-sensitive, which means it doesn’t care where you call it. It is also always in list mode. This means that listform does not work for article_custom, in that while you will not receive an error, listform will always be used over form, regardless of the conditions under which you call it.

The single/list conditionals don’t look at it from the same perspective: they are dependant upon the kind of url you’ve requested. If it is a link to an individual page, then it is individual. Otherwise, its a list.

Offline

#10 2005-11-06 02:30:48

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

Re: What is the point of "article" and "article_custom?"

Aesop1 — Thank you for your code example. It works perfectly. Basically, I have a landing page for my portfolio, under the section “portfolio,” but there are several categories like “logos,” “websites,” “illustration,” etc that I wanted in their own divs. So using your example code from above, the final output would be something like this:

<txp:if_article_list>
<div id="portfoliowebsites">
<dl id="portfoliolist">
<txp:article_custom section="portfolio" form="articlelist_portfolio" category="websites" sortdir="asc" />
</dl>
</div>
<div id="portfoliologos">
<dl id="portfoliolist">
<txp:article_custom section="portfolio" form="articlelist_portfolio" category="logos" sortdir="asc" />
</dl>
</div>
</txp:if_article_list>
<txp:if_individual_article>
<txp:article form="fullarticle_portfolio" />
</txp:if_individual_article>


Kevin
(graphicpush)

Offline

#11 2005-11-06 02:58:11

aesop1
Archived Plugin Author
Registered: 2004-09-19
Posts: 142

Re: What is the point of "article" and "article_custom?"

Kevin, I was a newbie once too, so the confusion was all too familiar to me (as new tags or plugins spring up, I become a newbie all over again).

Your code looks great too. Glad it’s working out.

Mary, I think what Maniqui and I were saying/suggesting/showing is in agreement with your description — no? It is nice to have someone say it in a more authoritative and declarative manner, however. Just wondering if I’m missing something?

Offline

#12 2005-11-10 17:13:44

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: What is the point of "article" and "article_custom?"

I understand what the differences between article and article_custom are but what I don’t understand is why the need for 2 seperate tags. Wouldn’t it be simpler to combine the two tags into one and have another attribute like context=“1” to make it context-sensitive or not?

Offline

Board footer

Powered by FluxBB