Help - Search - Members - Calendar
Full Version: Entry Loop Syntax Issue
Movable Type Community Forum > Using Movable Type > Categories and Entry Tags
homerlex
I am trying to iterate the authors and show 1 entry for each (there is a little more to what I want to accomplish but this example show the problem that I am having).

One of the MT professional services guys told me to do it like this:

CODE
<mt:authors>
   <mt:Entries author="<mt:AuthorName/>" lastn="1">
     <div>Cool!</div>
   </mt:Entries>
</mt:authors>


When I do a Save/Publish I get this error:
Publish error in template 'Main Index': Error in <mt:authors> tag: Error in <mt:Entries> tag: No such user '<mt:AuthorName/>'

Obviously there is a problem assigning the author filter like that. Could someone tell me the proper way to do this? I have emailed the MT guy but have not gotten a response yet. I need to get this resolved.

Thanks in advance!
imabug
sounds like MT isn't recognizing the <mt:AuthorName/> tag. perhaps try <mt:AuthorName /> instead
OtherNiceMan
Try <mt:AuthorDisplayName />, As I read it <mt:AuthorName /> context is <mt:Author /> not <mt:Authors/>

homerlex
QUOTE (imabug @ Apr 3 2008, 11:13 AM) *
sounds like MT isn't recognizing the <mt:AuthorName/> tag. perhaps try <mt:AuthorName /> instead


What is the difference in what you are suggesting? That space? The space did not help.
homerlex
QUOTE (OtherNiceMan @ Apr 3 2008, 11:17 AM) *
Try <mt:AuthorDisplayName />, As I read it <mt:AuthorName /> context is <mt:Author /> not <mt:Authors/>


This yields the same result.

Thanks for the quick replies guys. Any other ideas?
Su-
This:
QUOTE (homerlex @ Apr 3 2008, 09:44 AM) *
CODE
   <mt:Entries author="<mt:AuthorName/>" lastn="1">

...is not allowed.

You have to use variable interpolation if you need to use a template tag's value as an argument to another tag.
homerlex
QUOTE (Su- @ Apr 3 2008, 11:39 AM) *
This:
QUOTE (homerlex @ Apr 3 2008, 09:44 AM) *
CODE
   <mt:Entries author="<mt:AuthorName/>" lastn="1">

...is not allowed.

You have to use variable interpolation if you need to use a template tag's value as an argument to another tag.


Ding! We have a winner. Thanks a bunch Su!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.