Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2009-07-22 11:42:40

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Why txp:author links to frontpage only?

Vienuolis wrote:

will not fit the subject of this topic. Thank you very much!

Well then, trying to get back to your original question (as I understand it), you can use the article_custom tag to output posts from all sections, regardless of the “On front page” settings. You lose pagination, however.

Edit: On second thought, probably not a good solution — I was thinking it would be easy enough to grab the author name from a global variable, but forgot that you would need to convert from author real name to author login name. So back to a plugin to meet your exact requirements. On third thought: maybe it would work — see below.

Last edited by jsoo (2009-07-23 00:31:57)


Code is topiary

Offline

#17 2009-07-22 12:00:54

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Why txp:author links to frontpage only?

Perhaps <txp:article /> should have an attribute that allows overriding section “On front page” settings.


Code is topiary

Offline

#18 2009-07-22 23:26:31

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 327
Website GitHub GitLab Mastodon Twitter

Re: Why txp:author links to frontpage only?

you can use the article_custom tag

How the link could look like? <a href="?"><txp:author /></a> instead of <txp:author link="1" />. I have made a trial section ‘authors’ for one article per author, made its page template, form, and listform. Although first and last names are separated by %20 instead of - or + signs, the link <a rel="author" href="<txp:site_url />authors/<txp:author />"><txp:author /></a> is valid and would work. But not <txp:article_custom author='<txp:author />' />, probably because the tag article_custom is not context-sensitive in an article form.

I am curious, what is the problem to output author’s articles — an author’s name is assigned with his article in the database tightly, isn’t?

Offline

#19 2009-07-23 00:27:51

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Why txp:author links to frontpage only?

Vienoulis: this is a totally different solution than having the default template list authors articles, but should work. Just use txp:related_articles (instead of article_custom) in individual page template for author section to list the articles (after the txp:article tag to display the individual article for the “authors” section), and set the sections (all but “authors”, I suppose) that you want via the section attribute. That should do the trick.

Oh: and for this to work, the authors section articles have to be written by the author corrisponding to the title, each one. You can change author for the articles in the “articles” panel.

Last edited by Zanza (2009-07-23 00:29:19)

Offline

#20 2009-07-23 00:34:09

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Why txp:author links to frontpage only?

I had in mind something like this, in the default Page:

<txp:if_author>
<txp:article_custom author='<txp:php>echo $GLOBALS['pretext']['author'];</txp:php>' />
</txp:if_author>

Awkward, but it works. Again, you don’t get pagination, because article_custom doesn’t offer that.


Code is topiary

Offline

#21 2009-07-25 11:48:59

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 327
Website GitHub GitLab Mastodon Twitter

Re: Why txp:author links to frontpage only?

JSoo, your txp:php fits perfectly, thank you! I can also set <txp:article_custom form="authors" /> to render suitable list output. I have also set /authors/Name+Surname section articles as expired, thus they serves as convenient presentation intros (if_expired). Of course, made by its authors username, as advised Zanza. JSoo, you could publish this stunning trick on Txptips.com, o even on Textbook.

you don’t get pagination, because article_custom doesn’t offer that.

And why? I see, no sense for next and previous articles, although pagination of a list could look naturally, both for user and programmer.

Hope the lack of pagination would not impact painfully, though. I think good design should avoid pagination. On possible fail, I will install suggested bos_author plugin.

Bloke, I will try to take Textbook account on some occasion, hope you will rectify my mistakes.

Thanks folks, TxP community is brilliant!

Offline

Board footer

Powered by FluxBB