Created
June 13, 2012 22:28
-
-
Save mhulse/2926882 to your computer and use it in GitHub Desktop.
Caché DTI ContentPublisher: Tested in 7.6: Example of COS/CSP count of </p> tags to insert in-story ads...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<csp:object name="gStory" classname="dt.cms.schema.CMSStory" objid="28222340"> | |
<csp:if condition=($isobject(gStory))> | |
#[ new text set text = ##class(dt.cms.support.Rules).extractStoryElement("Text", gStory, 0) ]# | |
<csp:if condition=($length(text))> | |
<h1>With ad:</h1> | |
#($piece(text, "</p>", 1, 3) _ "</p>")# | |
<hr> | |
<p>Ad here...</p> | |
<hr> | |
#($piece(text, "</p>", 4, $length(text, "</p>")))# | |
<hr> | |
<h1>Full story:</h1> | |
#(text)# | |
</csp:if> | |
#[ kill text ]# | |
</csp:if> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment