4 Replies - 1567 Views - Last Post: 09 March 2016 - 09:09 AM Rate Topic: -----

#1 pnet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-March 16

pass a Coldfusion variable to og:description content field

Posted 09 March 2016 - 07:35 AM

0
down vote
favorite
I have a share to Facebook button on a page that displays obituaries. This site is coded in Coldfusion. What I am trying to do is pass the #obituarietitle# variable to the meta tag og:description like so: meta property="og:description" content="#obituarietitle#"

Through using the https://developers.f...ebug/og/object/ everything is showing up except the description which would be the name of the person who has passed. The "share" shows "#obituarietitle#" the variable.

I have tried cfoutput tags, cfsets, ect.

I am not seasoned with Coldfusion or og:. I don't know if this is possible.

Is This A Good Question/Topic? 0
  • +

Replies To: pass a Coldfusion variable to og:description content field

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: pass a Coldfusion variable to og:description content field

Posted 09 March 2016 - 08:37 AM

When you say you've tried a cfoutput tag...how so?

If the page hosting the button that you wish to insert the "obituarietitle" variable is CF then it's possible (as long as that variable actually exists on that page).

How about you cut and paste the code for the CF page hosting the button here (as long as it's not too lengthy) so we can see what you're trying to do? And describe where and how you tried a CFOUTPUT tag in it.

This post has been edited by Craig328: 09 March 2016 - 08:38 AM

Was This Post Helpful? 0
  • +
  • -

#3 pnet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-March 16

Re: pass a Coldfusion variable to og:description content field

Posted 09 March 2016 - 08:48 AM

For the cfoutput tags I tried the following (this is inside the <head>), but it broke my site so I removed it

<cfoutput><meta property="og:description" content="#obituarietitle#" /></cfoutput>
and <meta property="og:description" content="<cfoutput>#obituarietitle#"</cfoutput> />

This is the code in the <head>
<meta property="og:url"                content="http://www.xxx.com/obituaries-test.cfm" />
<meta property="og:type"               content="article" />
<meta property="og:title"              content="xxx.com - Obituaries" />
<meta property="og:description"        content="#obituarietitle#" />
<meta property="og:image"              content="http://www.xxx.com/images/header/fbimg.png" />


This is pulling everything in correctly except "og:description" content="#obituarietitle#"

The file for the <head> is a template, so appears on every page. The page hosting the button does have the obituarietitle variable.

Here is the code for the button
<a href="http://www.facebook.com/sharer/sharer.php?s=100&amp;p[url]=http://www.xxx.com/obituaries-test.cfm%23#obituarietitle#" target="_blank" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img src="http://www.xxx.com/images/facebook.png" border="0" /></a>



Was This Post Helpful? 0
  • +
  • -

#4 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: pass a Coldfusion variable to og:description content field

Posted 09 March 2016 - 08:50 AM

When you say "it broke the site" can you describe what the error message was?

Also, if the page itself isn't too long, try cutting and pasting the entire page into a CODE block in a new comment and I'll be pleased to have a look for you.
Was This Post Helpful? 0
  • +
  • -

#5 pnet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-March 16

Re: pass a Coldfusion variable to og:description content field

Posted 09 March 2016 - 09:09 AM

The page is rather long
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1