Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-11-13 18:36:46

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 208
Website

Is there a way to add Two or More Authors to one Article?

I want to show two authors of one article in my website. List theirs names and put a link in his names so I could see theirs other posts —individualy or collaboration—. Is it posible?

Last edited by robhert (2012-11-13 18:37:04)

Offline

#2 2012-11-13 21:12:09

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 208
Website

Re: Is there a way to add Two or More Authors to one Article?

I’ve followed this way: http://forum.textpattern.com/viewtopic.php?pid=229701#p229701 and I changed my categories by section. So I could use the categories as author names.

Offline

#3 2012-11-14 12:06:56

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: Is there a way to add Two or More Authors to one Article?

Hi robhert — you could also use custom fields so you are not limited to two authors maximum.

You could use custom_field and if_custom_field to extract the relevant author information.

There would need to be some cleverness with the categories, too.

  • Annie
  • Bertie
  • Cassie
  • Annie and Bertie
  • Bertie and Cassie
  • Annie and Cassie
  • Annie, Bertie and Cassie

…and then some code (which I don’t have, sadly) to query the custom field(s) in an article and link to the appropriate categories.

Last edited by gaekwad (2012-11-14 14:56:09)

Offline

#4 2012-11-14 12:27:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,795
Website GitHub

Re: Is there a way to add Two or More Authors to one Article?

gaekwad wrote:

you could also use custom fields

I thought about this approach too, even going as far as wondering if we could set a custom field called AuthorID so we didn’t have to mess about doing <txp:if_custom_field name="collaborator" value='<txp:author />'> inside an article_custom with a huge limit [ I do not recommend you try naming a CF after a textpattern internal field, btw as I trashed my installation doing it].

A multiple select input from glz_custom_fields would allow you to assign more than one person. There would of course only be one real author (database column AuthorID) stored against the article in the database, so the contributors would have to be of the same priv level with appropriate rights to allow them to both save the same article. Your hyperlinks could be manufactured to point to either site.com/author/Real+Name+Of+Author or perhaps to a custom section where you could do some clever article_custom / etc_query / smd_query to pull out the contributor’s articles.

But then I thought about the thing that Pete mentioned — multiple author search from the URL bar — and figured that was more a tagging problem than an author problem so unlimited categories or tags is the way to go (btw, smd_tags allows multiple query searches from the URL but it doesn’t work in 4.5.x yet).

It’s not ideal any way you slice it, but it can be done depending on the sort of functionality required.

Conclusion: inconclusive!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2012-11-14 13:23:22

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 208
Website

Re: Is there a way to add Two or More Authors to one Article?

Thank you guys! At first i thought in custom_field. Create one cf and save in it the AuthorId of the second author. So I could use if_custom_field to name and link the author’s name. But I didn’t find documentation so I gave up. But I’m going to try it again. Althought using categories I am approaching the same thing. Anyway I’m stating building a web magazine, so maybe I could find some troubles in the way.

Thank you again for your time dudes!

Offline

Board footer

Powered by FluxBB