1 person found this helpful
You can insert ColdFusion tags in that code. Just use <cfoutput> </cfoutput> around variables you want to insert into the code.
Also, be conscious of the # in the URL of the Facebook code in the line:
js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1";
If that gets surrounded by the <cfoutput> tag, it will throw an error due to ColdFusion thinking "#xfbml" is a syntax error.
To prevent that, you can use ##xfbml and the ## will be rendered on the page as a single #. But that is only if that line is inside a <cfoutput> tag.
I am using something similar with a custom facebook icon, here is my code:
I have the meta tags setup as above and they show up fine in the facebook debugger, however, when I try to share my page, it gives the default titles as if the meta tags have been bypassed.
Is there a way to use a custom icon and have coldfusion use the set metatags when sharing.
I don't know, this seems more of a Facebook question than a ColdFusion question. If you do a view source on the page in your browser, do the meta tags appear to be formatted correctly?