Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-06 16:15:09

agovella
Member
From: Houston, TX
Registered: 2005-05-01
Posts: 66
Website Twitter

Can a txp tag be the attribute value for another txp tag?

Looking at using TextPattern for a music site.

For each band, I want to have a profile page that lists all other content on the site for that band:
- album reviews
- albums (discography)
- band news
- band histories
- band interviews
- band photos

The above items are my categories.

Because I will easily have thousands of bands, I can’t add the band name as a category. (E.g. Have a category named Beatles thta I use for all Beatles content.)

What I’d like to do is create a profile page for each band. This would be an article and have an article ID.

Then, I’d like to generate a list of all album reviews (a category) where a custom field contains the current article id.

Can I nest the article id tag inside the article or article_custom tag? Can I do this?

<txp:article customfieldname="<txp:article_id />" />

Or do I need to create a custom tag?

(Edit: updated code to display properly. :) -Mary)

Last edited by Mary (2006-05-06 19:20:49)

Offline

#2 2006-05-06 17:12:02

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

Re: Can a txp tag be the attribute value for another txp tag?

If I understand you correctly, no, you can’t do that. You can’t have txp tags inside other txp tags. But have a look at chh_related_articles.

Offline

#3 2006-05-06 19:04:26

agovella
Member
From: Houston, TX
Registered: 2005-05-01
Posts: 66
Website Twitter

Re: Can a txp tag be the attribute value for another txp tag?

I’ll check this out. Mary also offered some code in response to another post today that exposes a way to customize queries.

I think my biggest hurdle is to try and figure out the best way to track the ids for all of the bands. This looks really good though. I could specify a category and then a custom field with the id assigned to the artist.

Thanks!

Offline

#4 2006-05-07 04:53:26

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Can a txp tag be the attribute value for another txp tag?

tags-in-tags, a wanna-be FAQ.

Offline

Board footer

Powered by FluxBB