Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Collect posts based on a category into a Section
Thought I should ask before I procceed to ensure I am on the right track and this is the proper TxP way.
I would like to have a Section eg, called Races. And any posts that I add to my default “blog” entry which appear on the default from page, I would like to also have them collected in a specific order into the section Races., based on a category that I assign such posts. So a subset of blog posts filtered into the Races section based on Category. Thoughts? suggested code?
…. texted postive
Offline
Re: Collect posts based on a category into a Section
Hi
If Blog article are assigned to Races section using txp:article in Racces url will pull them all, if the blog artticles are assigned to another section you need to use txp:article_custom to pull them.
Cheers.
Offline
Re: Collect posts based on a category into a Section
Dragondz wrote #335771:
if the blog articles are assigned to another section you need to use txp:article_custom to pull them.
Yup, so if your articles are assigned to the “blog” section and the relevant posts to the “races” category, you’d use a tag something like this in your page template for the races
section, to show just the relevant blog articles:
<!-- this code goes on the "races" section page template -->
<txp:article_custom section="blog" category="races" />
adding any further attributes you may need to denote the form to use, how many to show etc.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Collect posts based on a category into a Section
jakob wrote #335775:
Yup, so if your articles are assigned to the “blog” section and the relevant posts to the “races” category, you’d use a tag something like this in your page template for the
races
section, to show just the relevant blog articles:
<!-- this code goes on the "races" section page template -->...
adding any further attributes you may need to denote the form to use, how many to show etc.
thanks. i need to use this as what i ended up doing was not as elegant as i had “imagined’ doing. I went with a separate section. so back to the drawing board.
edited: PS I didn’t receive an email notifying me that this was posted.
Last edited by bici (2023-10-04 06:36:43)
…. texted postive
Offline