How to Read the Reference Guide
Dispatch tags are presented in the following format:
<dpHeadline
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
start="#p|#s|#w|#c|begin|end|resume"
stop="#p|#s|#w|#c|begin|end|resume"
length="#p|#s|#w|#c|begin|end"
>
The above syntax format should be read as follows:
Right: <dpHeadline style="upper" style="spaced">Wrong: <dpHeadline style="upper|spaced">
For comparison reference. The HTML <img> tag would be documented like this.
Only a portion of the attributes are being used for this example.
<img
src = "URL"
align = "left|right|top|middle|bottom"
alt = "default text"
width = "#"
height = "#"
>
Usually after the syntax of a tag is listed, its unique attributes are then defined. Frequently you will see a comment that says: "Please refer to the common attributes page for common attribute descriptions." The common attributes have been combined to a separate page to conserve space throughout the reference guide. To read about these attributes, follow the link as suggested.
D I S P A T C H T A G S Y N T A X R U L E S
Dispatch tags have similar syntax rules to HTML. If you can do it with HTML, you can probably do it with Dispatch tags.
Rules similar to HTML
Additional Rules
<meta name="keywords" content="<dpMetaKeywords>"><a href="<dpPageForwardUrl>">Page Forward</a>
Common Attributes
The common attributes are attributes that are common to most Dispatch tags. These attributes are: default, style, link, start, stop and length
Examples:
If a story has an author, the <dpAuthor> tag will display it as usual. You can also use the default attribute for the scenario of a story without an author.
| <dpAuthor default="Staff Writer"> | Staff Writer |
| <dpAuthor default="Anonymous"> | Anonymous |
An example of the default attribute used within the <dpHeadline> tag. Notice the use of nesting a tag within a tag.
| <dpHeadline default="<dpColumn>"> | Cinema Review |
In the following example, if the story has a summary, it is displayed as usual. If the story doesn't have a summary the default value is used. In this case the default value is the first two sentences of the story, followed by an ellipses.
| <dpSummary default="<dpStory length="2s">..."> | What's left to be said about Woody Allen? Or maybe the question is, "What does Woody have left to say?"... |
style="lower" - converts to "lower case".
style="upper" - converts to "UPPER CASE".
style="title" - converts to "Title Case". Note: use title case with caution. Due to the complexities of the English language, it may not always be 100% accurate.
style="spaced" - adds a space between each character. "s p a c e d"
style="roman" - converts to roman numeral: IX
style="decimal" - converts to decimal: 9
style="noHtml" - removes all HTML.
style="noHtmlStyle" - removes all HTML except paragraphs <p> and breaks <br>.
style="identifier" - converts to lower case letters with no spaces. This is primarily used for creating file names.
style="scriptEncode" - converts quotes, commas, and apostrophes to their numeric ASCII values. Primarily used within JavaScript or other scripting languages.
style="uriEncode" - encodes the text so it can be passed through a URL. This is often used for passing a query string on to an external search engine or commerce site.
style="chef", style="cockney", style="fudd", style="jive", style="kraut", style="newspeak", style="valspeak" - dialect translator Easter eggs. Read more about these here
Examples:
| <dpHeadline> | Censored stories, 1998 |
| <dpHeadline style="lower"> | censored stories, 1998 |
| <dpHeadline style="upper"> | CENSORED STORIES, 1998 |
| <dpHeadline style="title"> | Censored Stories, 1998 |
| <dpHeadline style="spaced"> |
|
| <dpHeadline style="roman"> | Censored stories, MCMXCVIII |
| <dpHeadline style="decimal"> | Censored stories, 1998 |
| <dpHeadline style="spaced" style="upper"> |
|
| <dpHeadline style="uriEncode"> | Censored+stories,+1998 |
link="on" - creates a link to the story associated with the tag.
link="off" - no link is created. This is the default value for most tags.
link="email" - creates an email link. Note: this is only available on the <dpAuthor> and <dpImageArtist> tag.
link="homepage" - creates a link to a homepage. Note: this is only available on the <dpAuthor> and <dpImageArtist> tag.
Examples:
| <dpHeadline> | Dolled Up Dreck |
| <dpHeadline link="on"> | Dolled Up Dreck |
| <dpHeadline link="off"> | Dolled Up Dreck |
|
<dpQuery author="this" max="3"> <dpHeadline link="on"><br> </dpQuery> |
Dolled Up Dreck Ashes to Ashes Tucci Feely |
| <dpAuthor> | Wil Gerken |
| <dpAuthor link="email"> | Wil Gerken |
| <dpAuthor link="homepage"> | Wil Gerken |
The text that is returned by a tag is known as a "string". By default, the entire string is returned, and these attributes are not used. However, if you would like to return only a portion of the string, or manipulate the string in any way, you will need to use some or all of these attributes.
start - where to begin within the string
stop - where to end within the string
length - the length to return, most commonly used by itself or in conjunction with start.
#p - number of paragraphs. 1p = one paragraph, 2p = two paragraphs, etc.
#s - number of sentences. 1s = one sentence, 4s = four sentences, etc.
#w - number of words. 1w = one word, 5w = five words, etc.
#c - number of characters. 1c = one character, 10c = ten characters, etc.
begin - the beginning of the string
end - the end of the string
resume - continue from where you just left off. "Resume" will be equal to "begin" on the first call, and then equal to where you ended for the next call.
Examples:
Note: Spaces are counted as characters, but consecutive spaces are counted as only one character.
| <dpHeadline> | All Fired Up |
| <dpHeadline length="1w"> | All |
| <dpHeadline length="2w"> | All Fired |
| <dpHeadline length="3w"> | All Fired Up |
| <dpHeadline length="3c"> | All |
| <dpHeadline length="5c"> | All F |
Note: "Start" always begins after what you specify as the starting position, as in these examples below:
| <dpHeadline start="begin"> | All Fired Up |
| <dpHeadline start="1w"> | Fired Up |
| <dpHeadline start="2w"> | Up |
| <dpHeadline start="2c"> | l Fired Up |
| <dpHeadline start="8c"> | d Up |
Note: "Stop" specifies what position to stop at, unlike "length" which specifies how much to return.
| <dpHeadline start="4c" stop="5c"> | F |
| <dpHeadline start="5c" stop="7c"> | ir |
| <dpHeadline start="2w" stop="3w"> | Up |
Display Tags
The display tags are the Dispatch tags that specifically relate to the fields in your publication's database, be it the headline, author, story or a user defined field. They are the most common of the Dispatch tags, and are primarily used to retrieve, manipulate and display information on a page.
<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:
<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" is the default and will always return all the authors of a story, be it one or many.
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 |
<dpAuthorCredit>
D E F I N I T I O N:
Returns the credit type for the author, such as "By" or "Edited By".
<dpAuthorCredit
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
<dpAuthorCredit> <dpAuthor>
would return: By Neil Gaiman
A more common use would be to test to see if the story has an author first:
<dpIf <dpAuthor>>
<dpAuthorCredit> <dpAuthor>
</dpIf>
<dpAuthorID>
D E F I N I T I O N:
The author ID of the story currently being built or queried. ID's are always in lowercase and contain no spaces. They are most commonly used to reference images or files.
<dpAuthorID
default="default text"
number="#"
return="value|count"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpAuthorID> |
jeffsmith |
<dpColumn>
D E F I N I T I O N:
The column that the story belongs to which is currently being built or queried.
<dpColumn
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpColumn> |
Music Feature |
|
<dpColumn style="lower"> |
music feature |
|
You're viewing: <dpColumn> |
You're viewing: Music Feature |
<dpColumnID>
D E F I N I T I O N:
The column ID that the story belongs to which is currently being built or queried. ID's are always in lowercase and contain no spaces. They are most commonly used to reference image names or files.
<dpColumnID
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpColumnID> |
smith |
|
<dpIf <dpColumnID> = "smith"> You're reading smith! <dpElse> You should really check out <a href="smith.html">Smith</a>. </dpIf> |
You're reading smith! |
<dpFile>
D E F I N I T I O N:
The file name of the story currently being built or queried.
<dpFile
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpFile> |
smith.html |
<dpFileID>
D E F I N I T I O N:
The file ID of the story that is currently being built or queried. <dpFileID> always returns the base file name, as in "cinema" or "cinema4", whereas <dpFile> would return "cinema.html" or "cinema4.html".
<dpFileID
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpFileID> |
smith |
<dpHeadline>
D E F I N I T I O N:
The headline of the story currently being built or queried.
<dpHeadline
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpHeadline> |
All Fired Up |
|
<dpHeadline style="upper" style="spaced"> |
|
|
<b><dpHeadline link="on"></b><br> <dpSummary> |
All Fired Up The Steak-Out, home of the $30 steak with no potato, burned down a week ago last Saturday. |
<dpHeadlineDefault>
D E F I N I T I O N:
This tag will return the headline value you have set for this column's default headline.
<dpHeadlineDefault
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpIssue>
D E F I N I T I O N:
The issue of the story currently being built or queried. This is also the directory name of the issue.
<dpIssue
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpIssue> |
1998-06-25 |
|
<dpIssue style="roman"> |
MCMXCVIII-VI-XXV |
<dpIssueID>
D E F I N I T I O N:
The issue ID of the story currently being built or queried. ID's are always in lowercase and contain no spaces. They are most commonly used to reference image names.
<dpIssueID
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpIssueID> |
1998-06-25 |
<dpIssueDate>
D E F I N I T I O N:
The issue date of the issue currently being built or queried.
<dpIssueDate
begin="strftime()"
separator="default text"
end="strftime()"
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
start="#p|#s|#w|#c|begin|end|resume"
stop="#p|#s|#w|#c|begin|end|resume"
length="#p|#s|#w|#c|begin|end"
>
The default format for <dpIssueDate> is: <dpIssueDate begin="%B %e - " begin="%B %e, %Y">, which returns a date in this format: "June 25 - July 1, 1999"
A T T R I B U T E S:
Please refer to the common attributes page for the common attribute descriptions.
strftime() values:
| Thursday | National representation of the full weekday name. | |
| Thu | National representation of the abbreviated weekday name, where the abbreviation is the first three characters. | |
| January | National representation of the full month name. | |
| Jan | National representation of the abbreviated month name, where the abbreviation is the first three characters. | |
| 01 | Month as a decimal number (01-12). | |
| 07 | Day of the month as a decimal number (01-31). | |
| 7 | Day of the month as a decimal number (1-31); single digits are preceded by a blank. | |
| 1998 | Year with century as a decimal number. | |
| 98 | Year without century as a decimal number (00-99). | |
| 01/07/98 | Equivalent to "%m/%d/%y". |
Additional strftime() values can be found here.
E X A M P L E S:
|
<dpIssueDate> |
June 25 - July 1, 1998 |
|
<dpIssueDate begin="%A" separator=" through " end="%A"> |
Thursday through Wednesday |
|
<dpIssueDate begin="%A through " end="%A"> |
Thursday through Wednesday |
|
<dpIssueDate begin="%B %e, %Y"> |
June 25, 1998 |
|
<dpIssueDate end="%B %e, %Y"> |
July 1, 1998 |
|
<dpIssueDate begin="%Y-%m-%d"> |
1998-06-25 |
|
<dpIssueDate begin="%B %e, %Y" style="upper"> |
JUNE 25, 1998 |
|
<dpIssueDate begin="%Y" style="roman"> |
MCMXCVIII |
<dpIssueNumber>
D E F I N I T I O N:
The issue number of the issue currently being built or queried.
<dpIssueNumber
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpIssueNumber> |
18 |
|
<dpIssueNumber style="roman"> |
XVIII |
|
<dpIssueNumber style="roman" style="lower"> |
xviii |
|
Volume <dpVolumeNumber> Issue <dpIssueNumber> |
Volume 15 Issue 18 |
<dpMetaDescription>
D E F I N I T I O N:
This tag will return the column's default meta description. You set this in column defaults.
<dpMetaDescription
default="default text"
style="lower|upper|title|spaced|roman|decimal|
noHtml|noHtmlStyle|identifier|scriptEncode"
link="on|off"
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:
Notice that style="noHtml" is the default for this tag. This will prevent potential HTML from side effecting meta tags.
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
<meta name="description" content="<dpMetaDescription>">
or better yet, use the summary if it exists and then fall back (default=) to the meta description if no summary exists:
<meta name="description" content="<dpSummary style="noHTML" default="<dpMetaDescription>">">
<dpMetaKeywords>
D E F I N I T I O N:
This tag will return the column's default meta keywords. You set this in column defaults.
<dpMetaKeywords
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Notice that style="noHtml" is the default for this tag. This will prevent potential HTML from side effecting meta tags.
Please refer to the common attributes page for the common attribute descriptions.
<dpSection>
D E F I N I T I O N:
The name of the section currently being built or queried. For example, if the story currently being built is within a section named "Music", <dpSection> would return Music.
<dpSection
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpSection> |
Currents |
|
<tt><dpSection style="upper" style="spaced"></tt> |
|
|
<dpIf <dpSection> = "music"> You're in the music section <dpElse> You're NOT in the music section </dpIf> |
You're NOT in the music section |
<dpSectionID>
D E F I N I T I O N:
The section ID of the story currently being built or queried. ID's are always in lowercase and contain no spaces. They are most commonly used to reference image names.
<dpSectionID
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpSectionID> |
currents |
|
<img src="../images/<dpSectionID>.gif"> |
|
<dpStory>
D E F I N I T I O N:
The story currently being built or queried.
<dpStory
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
start="#p|#s|#w|#c|begin|end|resume"
stop="#p|#s|#w|#c|begin|end|resume"
length="#p|#s|#w|#c|begin|end"
images="on|all|off|#|# to #|#,#"
imageStart="#p" (default is 0p)
imageStop="#p" (default is 3/4 way through story)
imageAlign="left|right|toggleLeft|toggleRight|center|none"
imageMacro="macro name"
>
A T T R I B U T E S:
<dpStory images="on">
<dpStory images="1, 3">
<dpStory images="2 to 4">
<dpStory images="2 to 4, 6">
<dpStory images="3 to <dpImageCount>">
right - all images align to the right.
left - all images align to the left
toggleLeft - images toggle left to right, back and forth
toggleRight - images toggle right to left, back and forth
center - centers image and follows it with a <p>
none
Examples:
<dpStory imageStart="2p" imageStop="10p">
This would put the first image after the second paragraph, and the last image after the 10th paragraph. All of the remaining images would be equidistantly dispersed within this range.<dpStory imageStop="14p">
If this story had three images, the first image would be before the first paragraph (default). The middle image would be after the 7th paragraph, and the last image would be after the 14th paragraph. If there was only one image, it would still be before the first paragraph and the imageStop attribute would be ignored.
When defining this layout, you can use any HTML you want and image tags "without" the number attribute. Dispatch will handle advancing the number values for the appropriate images. You may also use other Dispatch tags like conditional statements.
For example:
<dpMacro myImageLayout>Note: Like all macros, this macro needs to be declared before it is used, meaning it must be above whatever references it within your template.
<table border=1 align="<dpImageAlign>" width="<dpImageWidth>">
<tr>
<td>
Image Table<br>
<dpImage><br>
<i><dpImageCaption></i><br>
<font size=2><dpImageArtist></font>
</td>
</tr>
</table>
</dpMacro>
Usage would be as follows:
<dpStory images="all" imageMacro="myImageLayout">
Please refer to the common attributes page for the common attribute descriptions.
<dpSubheadline>
D E F I N I T I O N:
The subheadline of the story currently being built or queried.
<dpSubheadline
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpSubHeadline> |
Sonoita's Locals Lose An Institution Of Sorts. |
|
<i><dpSubHeadline></i> |
Sonoita's Locals Lose An Institution Of Sorts. |
|
<dpSubHeadline style="lower"> |
sonoita's locals lose an institution of sorts. |
<dpSubheadlineDefault>
D E F I N I T I O N:
This tag will return the subheadline value you have set for this column's default subheadline.
<dpSubheadlineDefault
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpSummary>
D E F I N I T I O N:
The summary of the story currently being built or queried.
<dpSummary
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpSummary> |
The Steak-Out, home of the $30 steak with no potato, burned down a week ago last Saturday. |
|
<b><dpHeadline link="on"></b><br> <dpSummary start="begin" length="9w">... |
All Fired Up The Steak-Out, home of the $30 steak with no... |
<dpSummaryDefault>
D E F I N I T I O N:
This tag will return the summary you have set for this column's default summary.
<dpSummaryDefault
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpUserField>
D E F I N I T I O N:
Returns the value contained in a user defined field (UDF) or the number (count) of values in a user defined field.
<dpUserField
name="(UDFname)"
number="#|all"
return="value|count"
realm="story|column|issue|all"
squeeze="no|yes"
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpVolumeNumber>
D E F I N I T I O N:
The volume number of the issue currently being built or queried.
<dpVolumeNumber
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpVolumeNumber> |
15 |
|
<dpVolumeNumber style="roman"> |
XV |
|
Volume <dpVolumeNumber style="roman"> Issue <dpIssueNumber style="roman"> |
Volume XV Issue XVIII |
Flow Control
Flow control tags relate to conditional statements, and looping constructs. The most common use of a flow control tag is a <dpIf> statement. Using <dpIf> you can perform tests within your template to decide how you want your page to render. For example, testing the character count of a story to decide how to present the images, ads, suggested links, or even if you want to split the story into multiple pages.
<dpIf>
D E F I N I T I O N:
Conditional tests allow you to make comparisons within your templates. For example, you can calculate how many characters are in a story, and provide a special layout for each circumstance.
Simple Condition Syntax
<dpIf (comparison statement)>
action
</dpIf>
Complete Condition Syntax
<dpIf (comparison statement)>
action
<dpElseIf (comparison statement)>
action
<dpElse>
action
</dpIf>
C O M P A R I S O N O P E R A T O R S:
| = | equal |
| != | not equal |
| in | is in set |
| not | not in set |
| gt | greater than |
| lt | less than |
E X A M P L E S:
The following can be read as "If the section for this story is music, then display the message You're in the music section":
<dpIf <dpSection>="music">
You're in the music section
</dpIf>
The following can be read as "If the section for this story is music, then display the message You're in the music section, else (otherwise) display You're not in the music section":
<dpIf <dpSection>="music">
You're in the music section
<dpElse>
You're not in the music section
</dpIf>
The following can be read as "If the section for this story is music, then display the message 'You're in the music section', else if the section for this story is film, then display the message 'You're in the film section', else (otherwise) display 'You're not in the music or film section' ."
<dpIf <dpSection>="music">
You're in the music section
<dpElseIf <dpSection>="film">
You're in the film section
<dpElse>
You're not in the music or film section
</dpIf>
The following can be read as "If you're not in the film section, display the message Go to the film section":
<dpIf <dpSection> != "film">
Go to the film section.
</dpIf>
<dpLoop>
D E F I N I T I O N:
Looping is most commonly used to step through a story, headline or other display tag by paragraph or font. However you can use it for whatever you want.
<dpLoop var="variable" from="#" to="#" step="#|-#">
Instructions to repeat.
</dpLoop>
A T T R I B U T E S:
E X A M P L E S:
<dpLoop var="i" from="1" to="10">
<dpVar i>
</dpLoop>
would create: 1 2 3 4 5 6 7 8 9 10
<dpLoop var="i" from="2" to="10" step=2>
<dpVar i>
</dpLoop>
would create: 2 4 6 8 10
<dpLoop var="x" from="1" to="<dpImageCount>">
<dpImage number="<dpVar x>">
</dpLoop>
would list all of the images in the story
<dpLoop var="x" from="1" to="<dpLength unit="p"><dpStory></dpLength>">
Paragraph #<dpVar x><p>
<dpStory start="resume" length="<dpVar x>p"><p>
</dpLoop>
would loop through the story one paragraph at a time from the first paragraph to the last paragraph. It would display the paragraph number followed by the paragraph itself.
Image Tags
The image tags allow you to get to access all the given information on a particular image or series of images. They are most commonly used to define an image macro, but can also be used independently for precision image placement and manipulation. For more information on image macros, see <dpStory>.
<dpImage>
D E F I N I T I O N:
Returns <img src="file.gif" width="100" height="220" alt="alt value">. In addition, you can push through any other values you want. The image tag will ignore everything but the number attribute and will just send your extras along.
<dpImage
number="#"
>
E X A M P L E S:
<dpImage number="#" align="right">
returns
<img src="file.gif" width="100" height="220" alt="alt value" align="right">
<dpImage number="#" align="left" onmouseover="doSomething()">
returns
<img src="file.gif" width="100" height="220" alt="alt value" align="left" onmouseover="doSomething()">
You can also override values as follows:
<dpImage number="#" width="5">
returns <img src="file.gif" width="5" height="220" alt="alt value">
<dpImageAlt>
D E F I N I T I O N:
Returns the alt value of the specified image.
<dpImageAlt
number="#"
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpImageArtist>
D E F I N I T I O N:
Returns the artist of a specific image referenced by the number. For example, if a story had three images, you would reference the second image's artist as follows: <dpImageArtist number="2">.
<dpImageArtist
default="default text"
number="#|all"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpImageCaption>
D E F I N I T I O N:
Returns the caption of a specific image referenced by the number. For example, if a story had three images, you would reference the second image's caption as follows: <dpImageCaption number="2">.
<dpImageCaption
number="#"
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpImageCount>
D E F I N I T I O N:
Returns the number of images the story has associated with it. For example, if a story had three images, <dpImageCount> would return "3".
<dpImageCount
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpImageCredit>
D E F I N I T I O N:
Returns the credit type of the artist, for the specific image referenced by the number. Example return values include "Photo by" and "Illustration by".
<dpImageCredit
number="#"
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpImageHeight>
D E F I N I T I O N:
Returns the height of the specified image.
<dpImageHeight
number="#"
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpImageID>
D E F I N I T I O N:
Returns the base file name of the image. No suffix.
<dpImageID
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
<dpImageURL> returns feature1-2.gif
<dpImageID> returns feature1-2
<dpImageNumber>
D E F I N I T I O N:
Returns the number of the "current" image. This would most commonly be used in an image macro to test for a specific image. For example, if it was the first image you may want to do something specific, or the last image.
<dpImageNumber
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
<dpIf <dpImageNumber> = 1>
tests if it is the first image
special treatment for the first image
<dpElseIf <dpImageNumber> = <dpImageCount>>
tests if it is the last image
special treatment for the last image
<dpElse>
default treatment (not the first or last image)
</dpIf>
<dpImageURL>
D E F I N I T I O N:
Returns the URL of the specified image. For example <dpImageURL number="1"> would return "feature2-1.gif".
<dpImageURL
number="#"
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
<dpImageWidth>
D E F I N I T I O N:
Returns the width of the specified image.
<dpImageWidth
number="#"
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
Miscellaneous Tags
The miscellaneous tags consist primarily of functions, like <dpLength> which calculates the length of a tag value or string by character, word, sentence or paragraph. Other miscellaneous tags include <dpMath> which allows you to perform mathematical operations, and <dpSpawn> which allows a template to create other pages within your site, most commonly used for server side includes or micro sites, like author archive pages.
<dpArray>
D E F I N I T I O N:
<dpArray> allows you to sort and display values you set in an array using <dpArrayElement>. It is most commonly used to display unique and sorted lists of authors in your database.
<dpArray
name="arrayName"
sort="ascending|descending|asc|desc"
number="all|#"
return="value|count"
>
A T T R I B U T E S:
E X A M P L E S:
<dpArray name="myList" sort="ascending">
myList has <dpArray name="myList" return="count"> values.
<dpLoop var="i" from="1" to="<dpArray name="myList" return="count">">
<dpArray name="myList" number="<dpVar i>" sort="ascending">
</dpLoop>
D E T A I L S:
<dpArrayElement>
D E F I N I T I O N:
<dpArrayElement> lets you define elements within an array. It is always used in conjunction with <dpArray>.
<dpArrayElement name="arrayName" key="sort value">
Value
</dpArrayElement>
A T T R I B U T E S:
D E T A I L S:
<dpComment>
D E F I N I T I O N:
<dpComment> provides a method for you to put comments within your template. Unlike HTML comments, these comments will be removed when the template is built.
<dpComment>Comment goes here.</dpComment>
<dpComment>
Comment goes here.
</dpComment>
A T T R I B U T E S:
Not applicable.
E X A M P L E S:
<dpComment>
--------------------------------------------------------------------------
Create a list of all the authors in my database.
--------------------------------------------------------------------------
</dpComment>
<dpQuery issue="all" realm="author" sort="author">
<dpAuthor><br>
</dpQuery>
<dpCurrentIssue>
D E F I N I T I O N:
This tag will return the issue/issueID of the latest issue in your database. It's purpose is primarily to use in a conditional test to see if the issue being built is the current issue or not.
<dpCurrentIssue
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
<dpIf <dpIssue> = <dpCurrentIssue>>
{create author archive pages}
</dpIf>
This Week in Film:
<dpQuery issue="<dpCurrentIssue>" section="film">
<dpHeadline link="on"><br>
<dpSummary><p>
</dpQuery>
<dpInclude>
D E F I N I T I O N:
<dpInclude> allows you to pull in (include) a template within a template. This is most commonly used for pulling in a template full of common macros, or design headers and footers.
<dpInclude
template="template name"
>
A T T R I B U T E S:
<dpLength>
D E F I N I T I O N:
<dpLength> returns the length of a string in paragraphs (p), sentences (s), words (w), or characters (c).
<dpLength unit="p|s|w|c">string or tag(s) to evaluate</dpLength>
A T T R I B U T E S:
Not applicable.
E X A M P L E S:
<dpLength unit="w">How many words?</dpLength> would return 3
<dpLength unit="w">How many characters?</dpLength> would return 18
A more common usage would be:
<dpVar totalParagraphs="<dpLength unit="p"><dpStory></dpLength>">
You now have a variable that holds the number of total paragraphs this story has. This can be used for layout purposes, statistical information like word count, a variable to determine if you should split this story into multiple pages, etc.
<dpMath>
D E F I N I T I O N:
<dpMath> lets you perform mathematical calculations within the tag and will return the result.
<dpMath calculation goes here>
O P E R A T O R S:
+, -, *, /, ( )
E X A M P L E S:
<dpMath 4+4> would return 8
<dpMath <dpLength unit="p"><dpStory></dpLength> - 4>
would return the length of the story in paragraphs subtracting 4.
<dpSpawn>
D E F I N I T I O N:
Spawn provides a method for a template to build additional files. This is most commonly used to generate server side includes, or to create and/or update mini sites.
This syntax it used to define a template inline. Mostly common for creating include files.
<dpSpawn path="relative path" file="file name">
template defined here
</dpSpawn>
This syntax references an external template you've defined in the Template Manager. This is a common method for mini sites.
<dpSpawn path="relative path" file="file name" template="template name">
A T T R I B U T E S:
E X A M P L E S:
The following code will build author archives for all of the authors in your database. It uses a template defined in the Template Manager called "author archives".
<dpQuery issue="all" realm="author">
<dpSpawn path="/archives/authors/" file="<dpAuthorID>.html" template="author archives">
</dpQuery>
Navigational Tags
The navigational tags relate specifically to directional navigation within your web site. They allow you to add features such as page forward and page back between stories, threading across issues within a specific column, page numbering systems, or hybrids of all of the above. See <dpQuery> for examples of site navigation related to suggested links, such as "more by this author", "recently in this column", or "other Jazz reviews".
<dpColumnURL>
D E F I N I T I O N:
The URL of a specific column being built or queried. This is most often used to point to the first story within a column, which may be a dynamic element, depending on your publication.
<dpColumnURL
column = "this|column|columnID"
>
A T T R I B U T E S:
<dpColumnURL column="this"> - smith.html
<dpColumnURL column="Jeff Smith"> -
<dpColumnURL column="curr"> - curr.html
E X A M P L E S:
|
<dpColumnURL> |
smith.html |
|
<a href="<dpColumnURL column="curr">">Go to the Currents Features</a> |
Go to the Currents Features |
<dpPageBackURL>
D E F I N I T I O N:
The URL of the previous page from the story currently being built or queried.
<dpPageBackURL>
A T T R I B U T E S:
Not applicable.
E X A M P L E S:
|
<dpPageBackURL> |
mailbag.html |
|
<a href="<dpPageBackURL>"><img src="../images/pageback.gif"></a> |
|
|
<dpIf <dpPageBackUrl>> <a href="<dpPageBackURL>"><img src="../images/pageback.gif"></a> </dpIf> |
|
<dpPageForwardURL>
D E F I N I T I O N:
The URL of the next page from the story currently being built or queried. Page sequence is determined by the order of the stories within pagination.
<dpPageForwardURL>
A T T R I B U T E S:
Not applicable.
E X A M P L E S:
|
<dpPageForwardURL> |
skinny.html |
|
<a href="<dpPageForwardURL>">Page Forward</a> |
Page Forward |
|
<dpIf <dpPageForwardURL>> <a href="<dpPageForwardURL>">Page Forward</a> </dpIf> |
Page Forward |
<dpPageNumber>
D E F I N I T I O N:
The page number of the story currently being built or queried.
<dpPageNumber
type = "issue|section"
position = "this|last|first"
default="default text"
style="lower|upper|title|spaced|roman|decimal|identifier|
noHtml|noHtmlStyle|scriptEncode|uriEncode"
link="on|off"
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:
<dpPageNumber type="issue"> - 2
<dpPageNumber type="section"> - 2
<dpPageNumber type="issue" position="this"> - 2
<dpPageNumber type="issue" position="last"> - 39
<dpPageNumber type="section" position="this"> - 2
<dpPageNumber type="section" position="last"> - 8
Please refer to the common attributes page for the common attribute descriptions.
E X A M P L E S:
|
<dpPageNumber> |
2 |
|
Page <dpPageNumber type="section"> |
Page 2 |
|
<dpPageNumber style="roman"> |
II |
|
The last page in this issue is page <dpPageNumber position="last"> |
The last page in this issue is page 32 |
<dpSectionURL>
D E F I N I T I O N:
The URL of a specific section being built or queried. This is most often used to point to the first story within a section, which may be a dynamic element, depending on your publication.
<dpSectionURL
section = "this|section|sectionID"
>
A T T R I B U T E S:
<dpSectionURL section="this"> - mailbag.html
<dpSectionURL section="City Week"> - cw.html
<dpSectionURL section="cityweek"> - cw.html
E X A M P L E S:
|
<dpSectionURL> |
mailbag.html |
|
The first story in this section is <a href="<dpSectionURL>"><dpSectionURL></a> |
The first story in this section is mailbag.html |
|
<a href="<dpSectionURL section="music">">Go to the Music Section</a> |
Go to the Music Section |
|
<a href="<dpSectionURL section="Currents">">Currents</a> . <a href="<dpSectionURL section="Music">">Music</a> . <a href="<dpSectionURL section="Cinema">">Cinema</a> . <a href="<dpSectionURL section="Books">">Books</a> . <a href="<dpSectionURL section="Review">">Review</a> . <a href="<dpSectionURL section="City Week">">City Week</a> |
Currents . Music . Cinema . Books . Review . City Week |
<dpThreadBackURL>
D E F I N I T I O N:
The URL of the previous story in this column's sequence.
<dpThreadBackURL>
A T T R I B U T E S:
Not applicable.
E X A M P L E S:
|
<dpThreadBackURL> |
../1999-05-07/smith.html |
|
<a href="<dpThreadBackURL>">Previously in this column</a> |
Previously in this column |
|
<dpIf <dpThreadBackURL>> <a href="<dpThreadBackURL>">Previously in this column (error checked)</a> </dpIf> |
Previously in this column (error checked) |
Queries
Queries allow you to query your database to find matches based on the criteria you set within the query tag. Common uses of queries include table of contents pages, suggested links, more stories by a specific author, previously in this column, page numbering systems, query if a story is running or not this issue, and much, much more.
<dpQuery>
D E F I N I T I O N:
<dpQuery
issue="this|all|archives|issue|issueID|
-this|-all|-archives|-issue|-issueID"
section="this|all|section|sectionID|
-this|-all|-section|-sectionID"
column="this|all|column|columnID|
-this|-all|-column|-columnID"
author="this|all|author|authorID|
-this|-all|-author|-authorID"
columnType="all|column|interstitial|
-all|-column|-interstitial"
userField="name|match|value"
volumeNumber="#|-#"
issueNumber="#|-#"
includethis="yes|no"
paginated="yes|no|all"
max="#"
min="#"
sort="issue|section|column|author|story|
-issue|-section|-column|-author|-story"
exclude="<dpQuery>"
realm="author|column|section|issue"
return="value|count"
>
Simple Query Format:
<dpQuery>
{Looping Query Section}
</dpQuery>
The query tag is a container tag, meaning it requires an opening and closing tag: <dpQuery></dpQuery>. To define and execute a query, the above syntax is all that is needed. However, you will usually use at least one attribute to refine your query for your specific needs.
Everything that appears within the {Looping Query Section} will be repeated for each match.
For example, the following syntax queries all of the publication's archives looking for matches of the cinema column. If it finds a match, it will output a linked headline of the matching story.
|
<dpQuery column="cin"> <dpHeadline link="on"> </dpQuery> |
Native Talent Last Night Stand Seeing Through The Roos X Marks The Plot etc. |
Complete Query Format:
The query tag also includes additional tags that can be optionally used within the query container to extend the functionality of the query tag.
<dpQuery>
{Header Section}
<dpLoop>
{Looping Query Section}
</dpLoop>
{Footer Section}
<dpFail>
{Failed Query Section}
</dpQuery>
The advantage to using the <dpLoop></dpLoop> container tag is so that you can define a {Header Section} and/or a {Footer Section}
The header and footer sections will only be displayed once for the entire query, where the information within the <dpLoop></dpLoop> container tag will be displayed for each match. Please see the examples below.
A T T R I B U T E S:
issue="this" - This is the default value and only queries the issue being built.
issue="all" - Queries all issues, including the issue being built.
issue="archives" - Queries all issues before the issue being built. The issue being built is not included, only the issues that precede it in date. Most commonly used for suggested links.
issue="issue|issueID" - You can specify a specific issue using <dpIssue>/<dpIssueID> format: yyyy-mm-dd. Example: issue="1999-10-22"
section="this" - limits the query to the current section being built. For example, if the page being built is in the film section, it would only query film.
section="all" - queries all sections. This is the default value.
section="section|sectionID" - queries a specific section you designate. Both <dpSection> & <dpSectionID> syntax can be used. Example: section="music"
column="this" - limits the query to the current column being built. For example, if the story being built is a cinema feature column, it would only query other stories that are cinema feature columns.
column="all" - queries all columns. This is the default value.
column="column|columnID" - queries a specific column you designate. Both <dpColumn> & <dpColumnID> syntax can be used. Example: column="cover"
author="this" - limits the query to the current author of the story being built. For example, if the story being built is written by Jeff Smith, it would only query other stories that were written by Jeff Smith.
author="all" - queries all authors. This is the default value.
author="author|authorID" - queries a specific author you designate. Both <dpAuthor> & <dpAuthorID> syntax can be used.
paginated="yes" - limits the query to paginated pages only. This is the default.
paginated="no" - limits the query to non-paginated pages only.
paginated="all" - queries both paginated and non-paginated pages.
includethis="yes" - tells the query to include itself, the story currently being built, within the query.
includethis="no" - tells the query not to include itself, the story currently being built, within the query. This is the default.
+ = ascending
- = descending
For example:
The following code first creates a list of up to 3 (max="3") stories by "this" author from the archives. It then performs a test to see if there were greater than 3 (gt 3) stories by this author in the archives. If there were, it puts in a link to their author archive page. If there weren't, nothing is displayed. The goal here was to prevent the "more..." link from being displayed unless there truly were more. <dpQuery return="count"> makes it easy to achieve this, and avoids incrementing variables.
<dpQuery issue="archives" author="this" max="3">
More by <dpAuthor>:<br>
<dpLoop>
<dpHeadline link="on"><br>
</dpLoop>
</dpQuery>
<dpIf <dpQuery issue="archives" author="this" return="count"> gt 3>
<a href="../archives/authors/<dpAuthorID>.html">more...</a><br>
</dpIf>
Another example for comparison:
Note: return="value" is the default, and therefore not needed.
<dpQuery issue="archives" column="music">
<dpHeadline><br>
</dpQuery>
would return this:
The Sound and the Fury
Scavengers of the Vast Wasteland
Make Your Mama Proud
High Impact
---
<dpQuery issue="archives" column="music" return="count">
would return "4".
E X A M P L E S:
|
<dpQuery column="cin"> <b>Recently in this column:</b><br> <dpHeadline link="on"><br> </dpQuery> |
Recently in this column: Native Talent Recently in this column: Last Night Stand Recently in this column: Seeing Through The Roos Recently in this column: X Marks The Plot etc. |
|
<dpQuery column="cin"> <b>Recently in this column:</b><br> <dpLoop> <dpHeadline link="on"><br> </dpLoop> </dpQuery> |
Recently in this column: Native Talent Last Night Stand Seeing Through The Roos X Marks The Plot etc. |
|
<b>Recently in this column:</b><br> <dpQuery column="danehy"> <dpHeadline link="on"><br> </dpQuery> |
Recently in this column: |
|
<b>Recently in this column:</b><br> <dpQuery column="danehy"> <dpHeadline link="on"><br> <dpFail> No matches found<br> </dpQuery> |
Recently in this column: No matches found |
Variables & Macros
Variables and Macros allow you to create your own macro subroutines, or save a value in a variable for later use within your template. A common use of macros would be a capsule style layout for your table of contents pages, or a subroutine to create suggested author links. It is also common to place all of your site's macros in their own file that your templates can all reference. Organizing your templates like this, can aid in streamlining and modifying your templates.
<dpMacro>
D E F I N I T I O N:
Macros are similar to variables, but rather than setting a value they define a series of instructions you can use within your template. If you end up doing the same thing more then once within your template, macros are usually a helpful shorthand.
<dpMacro macroName="value">
or
<dpMacro macroName>value</dpMacro>
Macro Usage:
<dpMacro macroName>
A T T R I B U T E S:
Not applicable.
E X A M P L E S:
<dpMacro myCapsuleStyle>
<b><dpHeadline link="on"></b><br>
<dpSummary><br>
<dpAuthor><p>
</dpMacro>
<dpQuery section="music">
<dpMacro myCapsuleStyle>
</dpQuery>
<dpQuery section="film">
<dpMacro myCapsuleStyle>
</dpQuery>
<dpMacroDefine>
D E F I N I T I O N:
<dpMacroDefine> is the preferred way of defining macros. By defining macros with <dpMacroDefine> you have the extra advantage of being able to call a macro from within macro definition.
<dpMacroDefine macroName>
macro
</dpMacroDefine>
A T T R I B U T E S:
Not applicable.
E X A M P L E S:
<dpMacroDefine linkLayout>
<dpHeadline><br>
<dpSummary><p>
</dpMacroDefine>
<dpMacroDefine sectionLinks>
<dpQuery issue="this" section="this">
<dpMacro linkLayout>
</dpQuery>
</dpMacroDefine>
<dpVar>
D E F I N I T I O N:
Variables allow you to create your own variables you can use within a template. Variables are usually used to save or set values you want to reference later in your template.
<dpVar variableName="value">
or
<dpVar variableName>value</dpVar>
Variable Usage:
<dpVar variableName>
A T T R I B U T E S:
Please refer to the common attributes page for additional details on the style attribute.
E X A M P L E S:
<dpVar myName="Deuteronomy">
My name is <dpVar myName>
would display
My name is Deuteronomy
<dpIf <dpColumnID>="feature">
<dpVar headerImage="cool_image.gif">
<dpElse>
<dpVar headerImage="plain_image.gif">
</dpIf>
<img src="<dpVar headerImage>">
would display cool_image.gif if it was the feature and plain_image.gif if it wasn't.
<dpVarDefine>
D E F I N I T I O N:
<dpVarDefine> is the preferred method of defining variables. The advantage to using <dpVarDefine> is the ability to nest variables. Note: all leading and trailing padding is removed from the variable definition.
<dpVarDefine variableName>
variable
</dpVarDefine>
A T T R I B U T E S:
Please refer to the common attributes page for additional details on the style attribute.
E X A M P L E S:
<dpVarDefine myCounter>
0
</dpVarDefine>
<dpVarDefine myCounter>
<dpMath <dpVar myCounter> + 1>
</dpVarDefine>
| Home: Support: Reference Guide | Questions? Comments? Please write support@desert.net. |