Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2006-07-12 12:02:30
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Problems using a custom field within another txp tag
Hmmmmmm….
Not so sure if it’s a plugin issue. I just tried it with plain old article_custom and that’s not doing the trick either. Makes me wish there was a plugin to parse tags within tags.
Anyway, I really appreciate the assist.. you always do go above and beyond the call of duty. :)
Offline
#17 2006-07-12 15:32:39
- jhyde
- New Member
- Registered: 2006-07-10
- Posts: 5
Re: Problems using a custom field within another txp tag
Above and beyond is right! Mary, a million thanks. My pages are now working correctly thanks to you. For those interested here is the code snippet I ended up using:
<code>
<txp:php>
global $thisarticle;
if (!empty($thisarticle[‘file_download_id’]))
{
$atts = array(‘id’=>$GLOBALS[‘thisarticle’][‘file_download_id’]);
$thing = ‘<txp:file_download_description /> [<txp:file_download_size format=“auto” decimals=“2” />]’;
echo file_download_link($atts, $thing);
}
</txp:php>
</code>
Where <code>file_download_id</code> is the name of my custom field.
Offline
#18 2006-07-16 01:48:52
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Problems using a custom field within another txp tag
UPDATE:
So it turns out that the chh_related plugin didn’t do the trick. I thought it did until I started making a bunch of articles and realized that it was not filtering the way I expected. It found article by custom field but ignores categories. So it’s back to square one, here.
The desperation sets in as I begin to peruse zem’s guide to developing plugins. One look at this tutorial (and php.net) is making me realize I wont be able to make my first plugin in time for my deadline this week..ha
But I do have a Paypal account and would gladly support the efforts of anyone who can help me solve this riddle.
The request seems simple enough. Tell TXP to retrieve a list of articles that meet both of the following conditions
1. Shares the same value of current article’s custom_3 (or in my case “HCM”)
2. Belongs to Category 1, 2 or 3 (These are categories other than the current article)
Any takers? (Tries hard not to look at Mary)
Last edited by Ace of Dubs (2006-07-16 01:52:14)
Offline
#19 2006-07-16 02:32:12
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Problems using a custom field within another txp tag
Waaaaiit a minute…
Belongs to Category 1, 2 or 3 (These are categories other than the current article)
What do you mean? Above your example stated it should have the categories, “Compilations” and “Reviews”. ?
Offline
#20 2006-07-16 02:46:22
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Problems using a custom field within another txp tag
Sorry, the previous request was just one example and I have since re-organized the content a bit… Let me explain better.
The site is for a record label and each release gets an article… on the release page I would love to have lists of articles that match the release catalog# (HCM which is custom_3) and show the categories like so:
bc..
h4. Related News
(Show related Compilations and Licensings)
h4. Feedback
(Show related Reviews and DJ Charts)
To clarify, I am not looking for articles that have BOTH categories selected in Cat1 Cat2… rather, the default behavior of listing all articles from each category (filtered by the custom field of course) is what I am after
Does this make sense?
Offline