Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2005-10-01 22:24:11

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

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

I would put this bit at the bottom of your txp:if_individual_article bit on the page template:

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

(hoping I’ve got the syntax right – have not had the time to try it).

Creat a form with the name “author_list” and fill it with the textpattern tags for the information you’d like to appear in the list of articles by that same author, i.e. for a list of linked article titles it might go thus (quoted from the textbook article I mentioned earlier)

<code><p><txp:permlink><txp:title /></txp:permlink></p></code>

The second comment you ask about was for plug-in writers who know what they’re doing (not I :-) – it is a suggestion for how a new plug-in function could be written by repurposing an existing function (txp:related_article) which does something similar for what you want to achieve (it selects related articles based on category at the moment, you want it to select them using author). For this you have to get under the hood, need to be PHP-savvy and understand some of the internal workings of textpattern.


TXP Builders – finely-crafted code, design and txp

Offline

#14 2005-10-04 18:56:43

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

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

Thank you Jakob.

I tried what you said. For some reason, the articles appeared were not the author of the article on the particular pages article but other static contents creat by myself, – admin…

I really don’t understand this… Do you have any more idea?

Offline

Board footer

Powered by FluxBB