Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-04-13 07:53:37

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 278

how to list the current section articles?

how to list the current section articles?
it will works fine if i type manually the section name
<txp:article_custom section="news" limit="3"> <txp:title /> </txp:article_custom>

but i need to use more dynamic like, it will not works:
<txp:article_custom section="<txp:section />" limit="3" /> <txp:title /> </txp:article_custom>

any one plz help me if i’m in any section, that should dynamically appear that section’s articles.
thank you

Offline

#2 2015-04-13 08:15:53

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: how to list the current section articles?

This should work:

<txp:article_custom section='<txp:section />' limit="3" /> <txp:title /> </txp:article_custom>

You should use single quotes for tags in tag.

Last edited by NicolasGraph (2015-04-13 08:21:56)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#3 2015-04-13 10:26:51

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 278

Re: how to list the current section articles?

thanks, it’s fine :-)
how i know these things in the future ?

Offline

#4 2015-04-13 11:01:17

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: how to list the current section articles?

raminrahimi wrote #289937:

thanks, it’s fine :-)
how i know these things in the future ?

Look at the documentation, and the FAQ

Last edited by NicolasGraph (2015-04-13 11:15:43)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#5 2015-04-13 11:06:32

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: how to list the current section articles?

txp:article shows articles of the current section.

The tag is context-sensitive, which means it will grab articles from the currently viewed section/category/author, etc.

Last edited by GugUser (2015-04-13 11:07:19)

Offline

#6 2015-04-13 11:11:34

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: how to list the current section articles?

GugUser wrote #289941:

txp:article shows articles of the current section.

I considered raminrahimi was looking for something to work on an other page than the section article list page as he used <txp:article_custom>.
Otherwise, of course, <txp:article /> do the job.

Last edited by NicolasGraph (2015-04-13 11:13:22)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#7 2015-04-13 11:44:16

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: how to list the current section articles?

raminrahimi wrote #289937:

how i know these things in the future ?

Here’s an aide-memoire:

Double for different
Single for same

Huhh, what … ?

Let me explain: Generally, it’s about two sorts of tags here: HTML and TXP. When you nest them inside apostrophes use single quotes when you nest the same ( = TXP) tags and double apostrophes (", how do you call these really, actually?) when you nest two different tag sorts (= TXP inside HTML).

Use 2 pairs of single ones '' for nesting TXP inside TXP inside TXP = 2 x same inside same.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#8 2015-04-13 15:46:07

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 278

Re: how to list the current section articles?

hmm thanks a lot, i understand :-)

Offline

Board footer

Powered by FluxBB