Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-08 23:42:19

the-bhp
Member
Registered: 2005-10-18
Posts: 26

Help on PHP needed (I guess): context-sensitive linking of articles

I am currently working on a site that provides profiles of bands and their records. What I want to do is to have on each band’s page a list of their records.

There will be a section for bands and a section for records. And it might be useful to store a band name as a keyword with each record and with each band.

So, in the form for the bands I need an output like that:
<code>
<txp:article_custom section=“records” keywords=”<txp:keywords />” />
</code>

But there’s two problems:

1. I can’t use txp:article_custom in forms. But txp:article doesn’t have the “section” attribute.
2. Tags within tags won’t work. But I want to have this “context-sensitive”.

Any suggestions? I have been thinking about this the whole evening…

Offline

#2 2005-11-08 23:53:55

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Help on PHP needed (I guess): context-sensitive linking of articles

txp:related_articles is similar to what you want. You could either adapt your method to use categories instead of keywords, or copy and adapt the existing tag as a plugin.


Alex

Offline

#3 2005-11-09 00:08:06

the-bhp
Member
Registered: 2005-10-18
Posts: 26

Re: Help on PHP needed (I guess): context-sensitive linking of articles

Thank you, that sounds quite interesting. I should have found that by myself…
Although, using categories might be a bit too complicated. But I’ll have a closer look tomorrow.

PS: Does this work in an article form?

Last edited by the-bhp (2005-11-09 00:12:20)

Offline

#4 2005-11-09 00:15:17

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Help on PHP needed (I guess): context-sensitive linking of articles

Yes, that’s what it’s for.


Alex

Offline

#5 2005-11-09 11:37:29

the-bhp
Member
Registered: 2005-10-18
Posts: 26

Re: Help on PHP needed (I guess): context-sensitive linking of articles

I just tried it and it works quite nice, but I need the option to assign a special form to the list, so that the article images or thumbnails can be displayed. I checked dru_recent_articles and glx_recent_articles, but they don’t do that either.

Offline

#6 2005-11-09 13:22:27

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

Re: Help on PHP needed (I guess): context-sensitive linking of articles

Would a modification of Sencer’s code come handy?

Offline

#7 2005-11-09 21:17:26

the-bhp
Member
Registered: 2005-10-18
Posts: 26

Re: Help on PHP needed (I guess): context-sensitive linking of articles

> wet wrote:

> Would a modification of Sencer’s code come handy?

Only partly cause I guess I still have the problem that article_custom doesn’t work in forms, or do I get this wrong?

But maybe I found a solution: forum.textpattern.com/viewtopic.php?id=10856

I’ll try that later today. But still, thanks a lot!

Offline

#8 2005-11-10 21:16:39

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Help on PHP needed (I guess): context-sensitive linking of articles

the-bhp,

Did you ever find a solution to this? I’m working on a site for a label and I need to accomplish pretty much exactly the same thing and I’ve run into all the same issues. I tried several PHP solutions, but there’s still the issue of getting it to display thumbnails. Any help would be appreciated. I’ll keep you posted on anything I discover.

Cheers,
Tom

P.S. TBHP rules. My friend Jimmy Lavalle played with them for a bit.

Offline

#9 2005-11-10 22:17:31

the-bhp
Member
Registered: 2005-10-18
Posts: 26

Re: Help on PHP needed (I guess): context-sensitive linking of articles

Hey renobird,

unfortunately, not yet. I’m close to giving in and use related_articles, which would be without thumbnails and which meant that authors had to create a new category for each new band they add. That’s not really how I want it to be since I don’t want to bother authors with the internal structure of the site.

If only tyom’s idea worked – it’s exactly what I need.

I’ll keep you updated if I find something.

PS: The BHP surely is one of my all-time favourite bands. Some of the best shows I ever saw were theirs. And, by the way: I’m also doing a website for a label :)

Last edited by the-bhp (2005-11-10 22:39:06)

Offline

#10 2005-11-10 23:29:23

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Help on PHP needed (I guess): context-sensitive linking of articles

Yeah…I’ve been attempting to get Tyom’s plug-in to work. Hopefully it’s something that we can get figured out. Between the 2 of us, we’ve got to be able to come up with a way to make this happen. It’s kind of essential for the site I’m working on. If I knew enough about programming I’d attempt a plug-in myself.

Cheers Mate,
Tom

Offline

#11 2006-01-05 22:15:01

the-bhp
Member
Registered: 2005-10-18
Posts: 26

Re: Help on PHP needed (I guess): context-sensitive linking of articles

Renobird, I still couldn’t find a solution that allows to show an image, so I settled for something less.

wild-zero.de

Check out the “Bands” link, you’ll find a list of releases for each artist. But without the image.

Offline

#12 2006-01-06 00:34:35

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Help on PHP needed (I guess): context-sensitive linking of articles

BHP,

Thanks for the update.

I ended up doing something very similar with chh_related_articles.
http://www.fightingrecords.com/index.php

on the mainpage under > featured artist > releases

BTW…nice job on your site.

Cheers,
Tom

Offline

Board footer

Powered by FluxBB