Created
November 21, 2012 04:49
-
-
Save mhulse/4123076 to your computer and use it in GitHub Desktop.
Caché DTI ContentPublisher v7.7.3: Handling a "WebEmbed" field from InCopy...
This file contains hidden or 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
<dti:file:include base="assets" file="/includes/webembed.csp" /> |
This file contains hidden or 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
<dti:story:element:exist field="WebEmbed"> | |
<script language="cache" runat="server"> | |
; Declare: | |
new webembed | |
; Initialize: | |
set webembed = ##class(%CSP.Page).UnescapeHTML(##class(dt.cms.support.Rules).extractStoryElement("WebEmbed", gStory, 0, "textonly")) | |
; Scrub: | |
set webembed = $replace(webembed, $c(38), "&") ; Ampersand. | |
set webembed = $replace(webembed, $c(8220), """") ; Left double quotation mark. | |
set webembed = $replace(webembed, $c(8221), """") ; Right double quotation mark. | |
set webembed = $replace(webembed, $c(8216), "‘") ; Left single quotation mark. | |
set webembed = $replace(webembed, $c(8217), "’") ; Right single quotation mark. | |
; Resolve expressions: | |
set webembed = $$resolvePP^%cspQuote(webembed) // Expand any ##()## in the stream. | |
</script> | |
#(webembed)# | |
#[ kill webembed ]# | |
</dti:story:element:exist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment