Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
Re: How do I create author "pages"
Gocom wrote:
The
<txp:author />
tag outputs RealName wheres thearticle_custom
’sauthor
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
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