Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-08-29 09:20:26
- wspence
- Member
- Registered: 2006-09-03
- Posts: 84
Problem with article author form...
I have been using this form for a while and all of a sudden I am seeing issues with it showing my name twice on the author field.
Perhaps you guys have some insite as to what is going on…but I’m clueless here
The form looks like this and of course is set up to change by the author of the story.
By:
<txp:if_article_author name="admin">
<txp:email email="wspence@hoovision.com" linktext="Walt Spence" title="Send an Email" /><br /> Editor, Hoovision.com
</txp:if_article_author>
<txp:if_article_author name="uvasportsfanatic">
<txp:email email="uvasportsfanatic@gmail.com" linktext="Dave, aka uvasportsfanatic" title="Send an Email" /><br /> Contributor and Webmaster of <a title="UVA Sports Fanatic" href="http://www.uvasportsfanatic.com/">UVA Sports Fanatic</a>
<txp:else />
<txp:author />
</txp:if_article_author>
Now the Problem is that its rendering like this…
By:
<a href="mailto:wspence@hoovision.com" title="Send an Email">Walt Spence</a><br />Editor, Hoovision.com
Walt Spence
In other words…showing my name twice. What’s up with that?
Thanks in advance!
ruud: changed formatting and removed irrelevant part of code
Last edited by ruud (2007-08-29 09:28:40)
Offline
Re: Problem with article author form...
When the author is ‘admin’, the first condition is true, so that prints the wspence email link
The second condition is false, so the ‘else’ part of that condition is used, printing just the walt spence name.
Tricky to fix, because what you really want is:
<txp:if_article_author name="admin">
<txp:email email="wspence@hoovision.com" ...
<txp:else />
<txp:if_article_author name="uvasportsfanatic">
<txp:email email="uvasportsfanatic@gmail.com" ...
<txp:else />
<txp:author />
</txp:if_article_author>
</txp:if_article_author>
… but such tag nesting won’t work in TXP 4.0.x, unless you do it like this:
<txp:if_article_author name="admin">
<txp:email email="wspence@hoovision.com" ...
<txp:else />
<txp:output_form form="parse_workaround" />
</txp:if_article_author>
form ‘parse_workaround’:
<txp:if_article_author name="uvasportsfanatic">
<txp:email email="uvasportsfanatic@gmail.com" ...
<txp:else />
<txp:author />
</txp:if_article_author>
Offline
Re: Problem with article author form...
I wish we had and else_if statement just for cases like this!
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Problem with article author form...
Or a switch/case/default statement.
Offline
#5 2007-08-29 10:56:48
- wspence
- Member
- Registered: 2006-09-03
- Posts: 84
Re: Problem with article author form...
So what you’re saying is this is just an error in parsing the code?
Offline
Re: Problem with article author form...
No, it works as intended. You’re just using the wrong code ;)
See the second part of my first post for a solution.
Offline
#7 2007-09-04 03:21:22
- wspence
- Member
- Registered: 2006-09-03
- Posts: 84
Re: Problem with article author form...
to help me understand what exactly is causing my name to appear twice. i’m not sure how exactly i’m not using the code incorrectly.
Offline
Offline
#9 2007-09-14 08:14:30
- wspence
- Member
- Registered: 2006-09-03
- Posts: 84
Re: Problem with article author form...
Thanks for the info. I still had to create two misc forms for this though to get it to look exactly the way I wanted. However, the ends justify the mean. Thanks so much!
Offline