Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-08-08 10:18:54
- candyman
- Member

- From: Italy
- Registered: 2006-08-08
- Posts: 684
Author's image beside the post title
I’m searching something like this for Textpattern: does it exist a plugin to do this?
I’d like to have author’s image (in a multi-authors weblog) beside the title of the post.
Thanks in advance.
Offline
Re: Author's image beside the post title
You could do something quite easily with the if_article_author tag in textpattern:
http://textpattern.net/wiki/index.php?title=Txp:if_article_author
e.g:
<txp:if_article_author name="admin">
<img src="/images/adminpic.jpg" alt="Photo of admin" />
</txp:if_article_author>
Last edited by jonhicks (2006-08-08 12:16:39)
Cheers,
Jon VC#9
Offline
Re: Author's image beside the post title
Perhaps this works as well (especially if the author name does not contains spaces or strange characters):
<code><img src=”/images/authors/<txp:author />.jpg” alt=“Photo of <txp:author />” /></code>
Store images with the name of the author (.jpg) in the /images/authors directory.
Offline
#4 2006-08-08 23:35:52
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Author's image beside the post title
…especially if the author name does not contains spaces or strange characters…
It wouldn’t/shouldn’t – author names have to be valid in URLs. :)
Offline
#5 2006-08-17 10:23:16
- candyman
- Member

- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: Author's image beside the post title
Mary wrote:
It wouldn’t/shouldn’t – author names have to be valid in URLs. :)
Sorry, I don’t understand… :( Can you explain? I’m a VERY newbie in TXP… :P
I found this plugin by wilshire: according to you it suits to obtain a result like this one done with WP?
Last edited by candyman (2006-08-17 10:26:14)
Offline
#6 2006-08-17 11:13:46
- Ace of Dubs
- Member

- Registered: 2006-04-17
- Posts: 446
Re: Author's image beside the post title
What she means is that you are right… you cant have spaces in the name. In order to be a valid URL, you need to use underscores or hyphens to separate first from last name. This is something TXP does automatically with your article titles…if you look at the “URL only title” field you will see this. Unfortunately there is no such feature for authors… the only solution that will work out of the box is the one proposed by Hicks.
I suppose another way to skin this cat would be with to cook up an admin-side plugin that would create the option to upload a photo to your profile under Site Admin and then output it to your articles with a special tag, like <code><txp:author_img /></code> or something like that.
Yet another option might be to use gravatars, so far I have only seen them used for comments but perhaps they could be manipulated to show on articles as well.
Edit: just took a look at that wilshire plugin. I say give it a spin…just may do the trick
Last edited by Ace of Dubs (2006-08-17 11:15:00)
Offline
Re: Author's image beside the post title
You can use a bunch of plugins in order to obtain what you need. This what I’d do. I tried, it works.
I have a multiauthor blog here. I don’t put a photo near the author name, but I could do that. I have a section called “autori”. Any author is an article in this section. The title is the author’s name. Assign the author of any of these articles to be the author itself. For any article in this section assign article image: the portrait of the author.
Now you need chh_related_articles plugin, that you’ll find here.
In front page articles form insert this:
<p><txp:chh_related_articles relation="author" section="autori" limit="1" form="photo" /> - <txp:author /></p>
In the photo form, simply put:
<txp:article_image />
You’re done.
Z.
Last edited by Zanza (2006-08-17 13:33:56)
Offline
Pages: 1