|
The following produces a two column layout of unique authors sorted alphabetically. To add links to the author archive page, modify the array element to include the desired link. For instance:
<a
href="../authors/<dpAuthorID number="<dpVar i>">"><dpAuthor number="<dpVar
i>"></a><br>
T A G C O D E:
<dpQuery issue="all" realm="author">
<dpLoop var="i" from="1" to="<dpAuthor return="count">">
<dpArrayElement name="myList" key="<dpAuthor number="<dpVar i>"
format="lastfirst">">
<dpAuthor number="<dpVar i>"><br>
</dpArrayElement>
</dpLoop>
</dpQuery>
<dpComment>
Set middle marker and offset by one if uneven so left side gets extra length.
</dpComment>
<dpVar top="<dpArray name="myList" return="count">">
<dpVar middle="<dpMath <dpVar top>/2>">
<dpIf <dpMath <dpVar top>%<dpVar middle>> != 0>
<dpVar middle="<dpMath <dpVar middle>+1>">
</dpIf>
<dpComment>
Render dual column table
</dpComment>
<table border="1" cellpadding="5" cellspacing="1">
<tr>
<td valign="top">
<ul>
<dpLoop var="i" from="1" to="<dpVar top>">
<li><dpArray name="myList" sort="ascending" number="<dpVar i>">
<dpIf <dpVar i> = <dpVar middle>>
</ul>
</td>
<td valign="top">
<ul>
</dpIf>
</dpLoop>
</ul>
</td>
</tr>
</table>
See also:
<dpArrayElement>,
<dpAuthor>,
<dpIf>,
<dpLoop>,
<dpMath>,
<dpVar>
A D D I T I O N A L < D P A R R A Y > E X A M P L E S:
S E E A L S O:
|