Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2009-06-24 18:52:20

gooberboy
Member
From: Seattle
Registered: 2008-02-15
Posts: 25
Website

Re: How do I create author "pages"

Okay, I have it working with this setup:

<h2>ABOUT <txp:author/></h2>
<txp:article_custom section="author" author='<txp:author/>' >
<txp:body />
</txp:article_custom>

I call this with a simple article tag:

<txp:article form=“bio” limit=“1” />

HOWEVER, the body text is only called if the author’s real name is a single word, and does not have a space. The <txp:author/> tag must not be passing the full name if it has a space, such as “John Smith,” to the article_custom tag.

Is there some way around this little bug? I’m so close!

Thanks again.

Offline

#14 2009-06-24 19:08:47

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How do I create author "pages"

gooberboy wrote:

HOWEVER, the body text is only called if the author’s real name is a single word, and does not have a space. The <txp:author/> tag must not be passing the full name if it has a space, such as “John Smith,” to the article_custom tag.

A bit my bad. The <txp:author /> tag outputs RealName wheres the article_custom’s author attribute expects name (AuthorID). Try:

<txp:php> global $thisarticle; echo $thisarticle['authorid']; </txp:php>

Instead of <txp:author />.

Last edited by Gocom (2009-06-24 19:09:37)

Offline

#15 2009-06-24 19:18:14

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

Re: How do I create author "pages"

Gocom wrote:

The <txp:author /> tag outputs RealName wheres the article_custom’s author attribute expects name (AuthorID).

Yep, that’ll work just fine. An alternative if you don’t mind another plugin (though it does have many other uses — I use it on all multi-author sites because it’s brilliant) is to use jmd_author to get at the bits the built in TXP tag cannot reach.

Last edited by Bloke (2009-06-24 19:19:00)


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

#16 2009-06-24 19:49:10

gooberboy
Member
From: Seattle
Registered: 2008-02-15
Posts: 25
Website

Re: How do I create author "pages"

Excellent. Gocom, thanks for the PHP code. Most generous.

I actually simply replaced <txp:author /> with <txp:jmd_author> and I was all set, because that plugin returns the username instead of real name. Awesome!

Many thanks to you all!

Offline

Board footer

Powered by FluxBB