|
You can test the length of a story in order to decide whether to display additional ads or suggested links on the side. This can be easily achieved with <dpLength>.
T A G C O D E:
Set a variable that contains the length of the story in characters, so you can use this value in conditional tests throughout your template.
<dpVar characterCount="<dpLength unit="c"><dpStory></dpLength>">
Then add your tests where needed.
<dpIf <dpVar characterCount> gt 1500>
# display side ads
</dpIf>
or
<dpIf <dpVar characterCount> gt 1500>
# display side ads
<dpElseIf <dpVar characterCount> gt 2000>
# display side ads and suggested links
</dpIf>
Another example, might be testing the number of paragraphs for image placement. This is just a variation on the code above.
<dpVar paraCount="<dpLength unit="p"><dpStory></dpLength>">
<dpIf <dpVar paraCount> gt 3>
<dpC>Start Images lower on the page</dpC>
<dpStory images="on" imageStart="2p" imageAlign="right">
<dpElse>
<dpStory images="on" imageAlign="right">
</dpIf>
See also:
<dpComment>,
<dpIf>,
<dpLength>,
<dpVar>
A D D I T I O N A L < D P S T O R Y > E X A M P L E S:
S E E A L S O:
Other tag examples that incorporate <dpStory>
|