There are a quite few people out there these days with TXP installations that have multi-author sites. They would like to create a linkable bio-article for each of their contributors. Fair enough. I had a look at this myself for a new site I recently did. I didn’t want to go with any plug-ins if possible because I wanted to keep things nice and simple for the customer. The method I came up with isn’t rocket science so I’ve no doubt it has been thought of before, but I thought I would explain it for those who may need a little help.

First of all I created a new section, which I simply called bios. It does not appear on the front-page nor is it selected by default. You can include it in search or feeds if you wish. I have a distinct feeling that using author for a section name may cause problems so avoid it.

This new section can use it’s own article form so design it how you will. You may want to have specific headers in the article for different bits of info.

Now there are 4 disadvantages to this method but then it is very simple:-

  1. There MUST be a bio article for ALL contributors otherwise the link I show below will go to a 404.
  2. The bio article title must be identical to the author name being used in the main articles. This is also due to the method of producing the link I show below.
  3. You cannot have 2 authors using the same name. Again this is down to the link I show below.
  4. You can only use it if you are using section/title type URLs.

So then I thought about how to create a link that would be different for each author and point to their own bio article. This link would need to pick up some unique information about the author of a particular article and go into the article form I am using for those articles. I came up with this:-

<p> <txp:image id="4" /> <a href="<txp:site_url />bios/<txp:author />">View <txp:author />'s Bio.</a> </p>

So what does this do? Well first there is an image if you want to use one in the link. If so change the id number, if not just remove the tag. Next comes the link itself. Notice the use of “txp:author”. This picks up the author name and uses it in the link address. This is the reason for the 4 disadvantages listed above.

It also uses the same tag in the link text so that the author’s name is shown there as well. I simply placed the code at the bottom of my article form so that there is a bio link on every article. Now you could have the link only appear when in single article view by using “txp:if_indvidual_article” tags around it or you could use “txp:if_article_list” tags for the opposite effect.

Now I hear you muttering “but I didn’t want a link there, I wanted a nice list in my sidebar” so let’s try that then. This is a method of extracting a list that I used for my “archives” articles. It use the “txp:if_different” tag. We are trying to extract a list of all the article titles you have in your new bio section and create a link to them so create a new article form:-

<txp:if_different> <li><txp:permlink><txp:title /></txp:permlink></li> </txp:if_different>

then place the following tag into your sidebar form:-

<ul> <txp:article_custom section="bios" form="newFormName" limit="9999" /> </ul>

You can also add in the sort attribute if you want the list sorted in a particular way. The resulting list styling will be in the manner of an unordered list so if you want something different you will need to adjust it to your requirements. An added benefit of using this listing method is that it avoids all of the above mentioned disadvantages except for item 3.

I’ve used the name “bios” for the section I created. You will need to change that in any of the link code to the name that you have used.