Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-02 03:01:43

progre55
Member
Registered: 2006-05-02
Posts: 668

Automatically Display/Append Information In An Article Based on Author

I will try to make this question as simple as possible.

In the past I have used the following tags to display information about an author. When I mean display information, I do not mean a link, but actual information about the author that displays as part of the article form.

<txp:if_custom_field name="Author" val="John Doe"> Description: <txp:body /> <txp:article_custom form="author_info" allowoverride="0" pgonly="0" /> <txp:else /> Description: <txp:body /> <txp:article_custom form="author_info" allowoverride="0" pgonly="0" /> </txp:if_custom_field>

Although this works, this will not be practical for a new project that has numerous Authors.

I am not apposed to creating a seperate article for each author and storing their information inside the articles. My problem is, that I can not (more accurately I can not have my client) easily put manually entries in the form for all current and future authors ….

What I was hoping is that there would be a way to create a statment that said something like ….

if (custom field x = abc) display (article titled = abc) … or something along those lines …

I was thinking that it is somewhat similar logic that I use when using Bloke’s slimbox and putting the “article-x” into a custom filed to pull all images in that category

Because of the Bloke plug in, I thought about entering all authors in a category with the category names John Smith Bio, Dave Anderson Bio and so on … but I am unceratin how to tie the two together so when you enter that in a custom field it pulls that article with the Bio ….

Sorry for the long question/explanation but any guidance would be greatly appreciated.

I know some discussion has occurred on this subject, but I did not see exactly this type of issue.

progre55

Offline

#2 2007-08-02 03:35:48

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Automatically Display/Append Information In An Article Based on Author

You do realize there are author tags like author and if_author, right?

Offline

#3 2007-08-02 05:17:35

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

Re: Automatically Display/Append Information In An Article Based on Author

And how about outputting the author-information from another article, which is posted to specific section (or category), like “authors”? And if every author makes information-article bythemselves, it would be even easier.

Like this (requires asy_wondertag ):

<txp:asy_wondertag>
<txp:article_custom author="<txp:author />" section="authors" limit="1" form="author-info" />
</txp:asy_wondertag>

Or if using chh_relatedarticles :

<txp:chh_related_articles relation="author" section="authors" limit="1" form="author-info" />

And putting them to inside the default, real article-form.

Cheers!

Last edited by Gocom (2007-08-02 05:26:34)

Offline

#4 2007-08-02 05:55:33

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Automatically Display/Append Information In An Article Based on Author

When you say Author, do you mean Author as in subject matter as content or Author as in contributor to the site?

Offline

#5 2007-08-02 12:20:23

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Automatically Display/Append Information In An Article Based on Author

Everyone:

Thanks for all the replys. Everytime I hear someone say something negative on this Forum about TXP I really shake my head. I think they miss the fact that not only is the application phenominal, but the community and people who support it are equally as impressive. Sorry to hear we lost Alex.

Mary

I do know about the author tag, but these are not “authors” in the sense of “contributor to the site,” but they are Authors of the content of the articles. I guess I could enter them in as “Authors/Users”, but I thought that there may be a better/easier solution ….

Gocom

That would work, I think if they were the actual contributors. I need to be able to create a link that when an article is posted it triggers information from another article based on a custom field .. at least that is what I think I need to do ….

Also, am I incorrect, but I thought chh_relatedarticles was a one to many type of relation. Since an author of content may have multiple articles, I am uncertain how I can put that plug in into play … any guidance would be appreciate …

rsilletti

Author of subject matter as content ….

Sorry for being a little unclear …

progre55

Last edited by progre55 (2007-08-02 12:28:05)

Offline

#6 2007-08-02 12:41:16

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Automatically Display/Append Information In An Article Based on Author

I do know about the author tag, but these are not “authors” in the sense of “contributor to the site,” but they are Authors of the content of the articles.

Huh? that’s what ‘authors’ are: article authors. You know how when you post an article, it lists whom wrote it both in the Write and Articles tabs?

Offline

#7 2007-08-02 12:46:10

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Automatically Display/Append Information In An Article Based on Author

Mary:

Sorry, I think I may still be unclear. The “Author” that you are refferring to I believe (or thought) was the actual user who inputted the article.

In my situation, there will be someone else who inputs the articles (on behalf of the authors or multiple authors), but is not the actual “Author” of the content. That is why I need to rely on another field/area to trigger the Authors” information ….

Thanks.

progre55

Offline

#8 2007-08-02 12:50:40

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Automatically Display/Append Information In An Article Based on Author

Remember that you can re-assign articles to authors after they’ve been posted via the Articles tab. Then all you need to worry about is multiple-author posts.

Offline

#9 2007-08-02 12:56:22

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Automatically Display/Append Information In An Article Based on Author

Mary:

Am I correct that if I head down this path, I need to register each Author in the Users Tab? …

Also, for Authors that have multiple articles could I do something similar to what Gocom suggested:

<txp:asy_wondertag> <txp:article_custom author="<txp:author />" section="authors" limit="1" form="author-info" /> </txp:asy_wondertag>

and put this into a bigger form such as :

Description:<BR><BR> <txp:body /><BR><BR> <txp:article_custom form="author_info" allowoverride="0" pgonly="0" /><BR><BR> Author: <txp:asy_wondertag> <txp:article_custom author="<txp:author />" section="authors" limit="1" form="author-info" /> </txp:asy_wondertag>

Thanks, again.

Offline

#10 2007-08-02 14:32:44

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 114
Website

Re: Automatically Display/Append Information In An Article Based on Author

progre55,

Like you, I use custom fields for the author’s name. The <txp:author /> tag is for the person who actually posts the article (in my case they are the editors.) The people who write the articles don’t log-in nor do they have accounts.

To provide more information about the people who write the articles, I create a new article in an “authors” section. The title of the article is always the person’s name.

When you save an article, Texpattern automatically saves the title “Jane Doe” as “jane-doe” and “Alfred E. Newman” as “alfred-e-newman.” Because of this, you can accurately predict what the URL will be.

The solution then is to use two custom fields:

Custom1="AuthorName"
Custom2="URL"

Which, in practice, turns into:

AuthorName="E. Annie Proulx"
URL="e-annie-proux"

So in your page you could use:

By <a href="/authors/<txp:custom_field name="URL" />" /> <txp:custom_field name="AuthorName" /></a>

and you would see

By E. Annie Proulx with a link to their info page.

(Note: I do this on a client’s site, not the website listed to the left. Sorry, I cannot demonstrate.)

Last edited by amordecosmos (2007-08-02 14:35:43)

Offline

#11 2007-08-02 15:17:20

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Automatically Display/Append Information In An Article Based on Author

amordecosmos, this sound like a good system… How do you go about the search limitations re custom fields?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#12 2007-08-02 15:42:03

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 114
Website

Re: Automatically Display/Append Information In An Article Based on Author

Search, of course, will index all articles in my author section just fine.

(eg: If you search for Newman, it will come up with the info page for Alfred E. Newman located at /authors/alfred-e-newman)

But you are right. Search will not index the custom fields thus the actual articles by the writers won’t be shown in the search results.

So, as a sidebar to the Author Info page, I add this code:

<txp:asy_wondertag> <txp:article_custom URL="<txp:article_url_title />" sortby="Title" /> </txp:asy_wondertag>

This gives me a list of the writer’s articles down the side of their info page. Again, only the Author Info page is indexed but if the reader clicks on the info page in the search, they will see all the articles so it works for me.

(Note: <txp:article_url_title /> is a 4.0.5 tag [Thanks!] And obviously I use the asy_wondertag plug-in to make it work. I heart the asy_wondertag plug-in. It has saved me many-a-time.)

Last edited by amordecosmos (2007-08-02 15:44:08)

Offline

Board footer

Powered by FluxBB