Created
October 31, 2011 18:51
-
-
Save mhulse/1328449 to your computer and use it in GitHub Desktop.
Caché DTI ContentPublisher: Web Facebook Image URI code example...
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
| <csp:comment> FOR FACEBOOK: </csp:comment> | |
| #[ new img set img = "" ]# | |
| <csp:if condition=($data(gStory))> | |
| #[ set img = ##class(csp.web.assets.methods.image).imageUri("288pxw", gStory) ]# | |
| </csp:if> | |
| <csp:if condition=($length(img))> | |
| <link rel="image_src" href="http://registerguard.com#(..UnescapeHTML(img))#"> | |
| <csp:else> | |
| <link rel="image_src" href="http://www3.registerguard.com/images/rg.png"> | |
| </csp:if> |
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
| <csp:comment> Global head include... Include on index.csp and story.csp templates. </csp:comment> | |
| ... | |
| <dti:file:include base="assets" file="/includes/csp/facebook.inc.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
| <script language="cache" method="imageUri" arguments='field:%String="", cmsStory:dt.cms.schema.CMSStory=-1' returntype="%String" procedureblock="1"> | |
| set return = "" | |
| if ($length(field) && $isobject(cmsStory)) { | |
| set cmsPictureId = ##class(dt.cms.support.Rules).extractPicture(field, cmsStory, 0) | |
| if (cmsPictureId '= -1) { | |
| if ($isobject(##class(dt.cms.schema.CMSPicture).%OpenId(cmsPictureId))) { | |
| set return = ##class(dt.cms.support.Rules).getSrcStream(cmsPictureId) | |
| } | |
| } | |
| } | |
| quit return | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment