Home: Support: Reference Guide: Display Tags: <dpAuthor>

<dpAuthor>

D E F I N I T I O N:

The author of the story currently being built or queried. By default <dpAuthor> will always return all of the authors of the story.

<dpAuthor
  format="standard|initials|fmlast|firstlast|lastfirst|first|middle|last"
  number="#|all"
  return="value|count"
  default="default text"
  style="lower|upper|title|spaced|roman|decimal|identifier|
         noHtml|noHtmlStyle|scriptEncode|uriEncode"
  link="on|off|email|homepage"
  start="#p|#s|#w|#c|begin|end|resume"
  stop="#p|#s|#w|#c|begin|end|resume"
  length="#p|#s|#w|#c|begin|end"
>


A T T R I B U T E S:

format="standard|initials|fmlast|firstlast|lastfirst|first|last|middle"

Using "Kay Anne Sather" as an example:

<dpAuthor format="standard"> - Kay Anne Sather
<dpAuthor format="initials"> - KAS
<dpAuthor format="fmlast"> - K A Sather
<dpAuthor format="firstlast"> - Kay Sather
<dpAuthor format="lastfirst"> - Sather, Kay
<dpAuthor format="first"> - Kay
<dpAuthor format="middle"> - Anne
<dpAuthor format="last"> - Sather

number="#|all"

If their are multiple authors of a story, you may optionally reference the individual authors using the number attribute. For example number="1" would return the first author and number="2" would return the second author.

number="all" is the default and will always return all the authors of a story, be it one or many.

return="value|count"

By default all author(s) names are returned (return="value"). You may optionally return the count which tells you how many authors an individual story has, and then loop through the authors one by one using the number attribute.

For example:

<dpIf <dpAuthor return="count"> = 1>
     {do the regular author layout}
<dpElseIf <dpAuthor return="count"> gt 1>
     {do the multi author layout and loop through the authors}
</dpIf>

The following expands on this concept and creates a link to the author's archive page. If there are multiple authors, it will create a link to each author's individual archive page by looping through them.

<dpIf <dpAuthor return="count"> = 1>
   <dpAuthorCredit> <a href="../authors/<dpAuthorID>.html"><dpAuthor></a>
<dpElseIf <dpAuthor return="count"> gt 1>
   <dpAuthorCredit>
   <dpLoop var="i" from="1" to="<dpAuthor return="count">">
      <a href="../authors/<dpAuthorID number="<dpVar i>">.html">
      <dpAuthor number="<dpVar i>"></a>
      <dpIf <dpVar i> lt <dpAuthor return="count">>
        ,
      </dpIf>
    </dpLoop>
</dpIf>

The idea is to loop through however many authors you have (from="1" to="<dpAuthor return="count">"), and then process each one individually, using the number attribute and the loop variable (<dpVar i>).

An additional test is performed to see if it is the last author or not. If it isn't a comma is displayed.


Please refer to the common attributes page for the common attribute descriptions.


E X A M P L E S:

<dpAuthor>
Jeff Smith 
<dpAuthor link="email">
Jeff Smith 
<dpAuthor format="initials">
JS 
<dpIf <dpAuthor>>
  <i><dpAuthorCredit> <dpAuthor></i>
</dpIf>
By Jeff Smith  


Home: Support: Reference Guide: Display Tags: <dpAuthor>
Questions? Comments?
Please write support@desert.net.