Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-09-27 15:31:14

liyuyu
Member
From: Slough, England
Registered: 2005-09-23
Posts: 26
Website

Plugin Reguest: List articles titles by the same author

Well, hope I can describe clearly enough of what I need.

I’d like to have a plugin that can list articles by the same author based on the article page that the user is currently reading. i.e, I have ‘The First Article Name’ by ‘The First Author’ and ‘The Second Article Name’ by ‘The Second Author’ on the front page, when users click ‘The First Article’, they will go to its perminent link to read the full article, and at the end of the article, they will see ‘Read other articles by this author’ (in this case, it should be ‘The First Author’’s articles). If users click ‘The Second Article’, they will go to its perminent link to read the full article, and at the end of the article, they will also see ‘Read other articles by this author’ (in this case, it should be ‘The Second Author’s articles).

Example here: http://www.boxesandarrows.com/archives/conference_wrap-up_ia_in_germany_-_chances_and_perspectives.php (please scroll down to the bottom of the page)

If there’s already a plugin can do this, please let me know.

Can anybody help? Thank you very much!

Offline

#2 2005-09-27 16:49:22

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Plugin Reguest: List articles titles by the same author

The <a href=“http://textpattern.net/wiki/index.php?title=Txp:author_/”>Txp:author</a> tag may give you what you need without a plugin. It is part of your article form and the link attribute allows you to return a list of articles by that author.

Offline

#3 2005-09-27 17:00:57

liyuyu
Member
From: Slough, England
Registered: 2005-09-23
Posts: 26
Website

Re: Plugin Reguest: List articles titles by the same author

Thanks. But that is not what I need.

I need sth like this:

If Author A has written the follwoing articles:
Article 1
Article 2
Article 3

I’d like to display it at the end of Article 1 like this:
read other articles by the same author:
Article 2
Article 3

at the end of Article 2:
read other articles by the same author:
Article 1
Article 3

Please see the example I provided at the first post. (sorry, I don’t know how to make the link work)

Can Txp:author tag do this?

Last edited by liyuyu (2005-09-27 17:01:33)

Offline

#4 2005-09-27 17:57:31

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: Plugin Reguest: List articles titles by the same author

According to my knowledge such a plugin is yet to be made. You may find <a href=“http://textpattern.org/plugins/117/rssifauthor”>rss_if_author</a> helpful to a certain extent (Though it may not help you ahieve what you want).


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#5 2005-09-27 20:03:50

liyuyu
Member
From: Slough, England
Registered: 2005-09-23
Posts: 26
Website

Re: Plugin Reguest: List articles titles by the same author

Thanks. I checked that but that is not what I need. I can’t specify an author’s name because I don’t know which author’s article the user is reading. If I have Author 1 and Author 2’s article on the front page, when user click user 1’s article, the article list displayed at the end of the article should be author 1’s article, if user click Author 2’s article, then should have other articles written by author 2 at the end of the page. Hope I have explained this clear..

Any other ideas?

Offline

#6 2005-09-28 16:47:46

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: Plugin Reguest: List articles titles by the same author

You can list article by author with rss_suparchive

Some more info buried in the thread on the plugin.

Its not going to exclude the current article as you were asking but could probably be hacked to do so.

Offline

#8 2005-09-29 00:02:53

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: Plugin Reguest: List articles titles by the same author

No, that’ll give articles by a specific author. What is needed here is something to go in an article form and display other articles by the author of that article. jakob, what you’ve suggested would work great but would need to be hard-coded for each author. Not very flexible.

-Kurt


kurt@kurtraschke.com

Offline

#9 2005-09-29 13:02:32

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: Plugin Reguest: List articles titles by the same author

thinking aloud here without trying it out, so apologies if I’m barking up the wrong tree: how about feeding the output of txp:author into the txp:article_custom form? i.e.

<code><txp:article_custom form=“author_list” author=”<txp:author />” /></code>

There’s the problem of the txp:author single tag escaping the txp:article_custom mid-output but you can get around that by using a different notation by calling them as php:

<code>< txp:php>$authname = author(array(“link”=>“0”));echo article_custom(array(“author”=>”$authname”,“form”=>“author_list”));< /txp:php></code>
or something along those lines

would that do it?

or else make a function based on txp:related_articles using authorid as criteria rather than category.


TXP Builders – finely-crafted code, design and txp

Offline

#10 2005-09-29 21:27:56

liyuyu
Member
From: Slough, England
Registered: 2005-09-23
Posts: 26
Website

Re: Plugin Reguest: List articles titles by the same author

Thanks Jakob. I’ll try this to see if it works. However, I know this questions probably very silly, but could you please explain a bit more of < txp:php>$authname = author(array(“link”=>“0”));echo article_custom(array(“author”=>”$authname”,“form”=>“author_list”));< /txp:php>..Where should I put it?

Offline

#11 2005-09-30 18:41:31

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: Plugin Reguest: List articles titles by the same author

you use it in place of the normal tag construction listed above it – it should do exactly the same if I’ve got the syntax right. It’s another way of writing the same thing.
What it does is first call the function txp:author and stores the author’s name temporarily in $authname. Then it calls the function txp:article_custom using the form “author_list” (you have to define that as a textpattern form – see the article mentioned further up) and author=”$authname” i.e. the name of the author of the current article that we just found out.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2005-09-30 19:00:07

liyuyu
Member
From: Slough, England
Registered: 2005-09-23
Posts: 26
Website

Re: Plugin Reguest: List articles titles by the same author

Hi Jakob,

Could you please tell me what I should write in the author_list form? Sorry I’m really new to all these things. Also, how do I use authorid insteat of category on txp:related_articles?

Thank you very much for your time!!

Offline

Board footer

Powered by FluxBB