Topic-icon SCSocialWidget for sharing dynamic url

Active Subscriptions:

None
11 years 9 months ago #46501 by pawan.m
Alex,
I am trying to use the SCSocialWidget to share a url to facebook (specified the provider in admin configuration), by specifying its module 114 in a php layout file with moduleAnywhere (of nonumber.nl).
Since I want dynamic url for resumes generated by us: I need to specify the url to be posted: however not able to do that using SCOpenGraph or meta properties.

{SCOpenGraph url=http://www.maslowed.me/staging/Pawan/1081/it}
{module 114}
Is SCOpenGraph the right way to use SCSocialWidget? Can SCSocialWidget take url as a parameter in some manner.
Should we use meta property specification in html body before the SCSocialWidget to specify the properties?
<meta property="og:url" content="maslowed.me">
<meta property="og:image" content="images/logo_new.png">
Should I use some other JFBConnect api/widget for this purpose?
The topic has been locked.
Support Specialist
11 years 9 months ago #46510 by alzander
The {SCOpenGraph url=...} tag should work. What is or isn't happening when you try that tag? The og:url tag you're trying to set should specify the canonical/absolute URL for the current page. It generally shouldn't be for a completely different page.

Also, please note that after you set the OpenGraph tags, it can take Facebook a few days to detect the change. To update their cache, please use a tool like Social Debug , which will refresh the Facebook cache and give you a preview of what your page would look like if shared.

If you want a Like button for a completely different page, you'd want to set that in the SCSocialWidget parameters.

Instead of the SCSocialWidget, you can use the easy tags, like:
{JFBCLike href=http://site.com/page-to-share.html}
I hope that helps, but if you're looking for something else, just let me know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 9 months ago #46628 by pawan.m
Basically, I use {SCOpenGraph url=http://www.maslowed.me/staging/Pawan/1081/it}
{module 114}
on a page that is just providing a facility to the user to share this resume page, that our application generates, but it not on the same page.
With above code, I am getting the Share button, but on pressing, it is taking the facebook.com url, and not the url set by SCOpenGraph.

Eventually I was hoping to make this a dynamic parameter url. But if you say that facebook allows only urls related to current page, then I can't allow the share to be done from any other page.
- Do I need to restrict the share functionality to the actual page being generated? IN that case, it will become impossible to share in-session generated pages, which the user wants to share as a different out-of-session friendly url: for others to see.
- Can SCOpenGraph take a dynamic url parameter per session, or this is not possible since the change has to be via Facebook cache for current page?
{SCOpenGraph url=<php echo $dynamic_url?>}
The topic has been locked.
Support Specialist
11 years 9 months ago #46640 by alzander
The SCOpenGraph url=.. tag will only work for the current page that's being shared. So, if a user "Likes" or shares the current page, Facebook will instead grab the data for the page set in the og:url tag.

If you're not sharing the current page, then the og:url tag won't have any impact on that share.

Instead, you'll want to use a dynamic URL with the {JFBCLike} tag, which can create a Like button for a different URL:
{JFBCLike href=<?php echo $dynamic_url; ?>}
That Like button will be for the dynamic_url page. If that dynamic_url page has an og:url tag set to a different page, then Facebook would follow the chain until the final destination page.

I hope that helps explain,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 9 months ago #46670 by pawan.m
Alex,
to make this work, if we give another page url to the {JFBCLike href=<?php echo $dynamic_url; ?>}, do we need to turn SCOpenGraph off in some manner, as I understand that it adds og meta tags on all pages, and so something else may get shared.
The topic has been locked.
Active Subscriptions:

None
11 years 9 months ago #46671 by pawan.m
I am able to share the url when the SCSocialWidget module is placed on the page itself, and it is working good (cant use JFBCLike as we want share url, not like).
- I am unable to set even other meta properties such as image and title using appropriate php echo statements in the templates/<our_frontend_template>/index.php file head section. Do we need to put the code in some jfbconnect designated function/place: is it overriding the meta properties set elsewhere?

<meta property="og:url" content="<?php echo JURI::current();?>"/>
<meta property="og:title" content="<?php echo $_REQUEST;?>"/>
<meta property="og:description" content="An insightful profile of <?php echo $_REQUEST;?>" />
<meta property="og:type" content="Profile" />
<meta property="og:image" content="maslowed.me/images/logo_share.png" />
The topic has been locked.
Support Specialist
11 years 9 months ago #46678 by alzander

if we give another page url to the {JFBCLike href=<?php echo $dynamic_url; ?>}, do we need to turn SCOpenGraph off in some manner,

No, you don't. The destination URL (what is stored in $dynamic_url) should have Open Graph tags set by JFBConnect that should be correct for that page. The og:url setting on the $dynamic_url page should be the URL for that page, so that is correct.

- I am unable to set even other meta properties such as image and title using appropriate php echo statements in the templates/<our_frontend_template>/index.php file head section. Do we need to put the code in some jfbconnect designated function/place: is it overriding the meta properties set elsewhere?

You shouldn't need to set the tags directly in your index.php file. You should be setting them on a per-page basis using the {SCOpenGraph ...} tags. JFBConnect will replace any og:title, og:description and og:url tags you set manually through echo statements. og:image tags can be duplicated, so we don't replace those. However, if you set an og:image tag in your template, that will be used on every page of your site, which generally is not recommended.

On the page that you are sharing (*not* the page with the share button itself), add the {SCOpenGraph ..} tags that you want to use. That will set the tags for the page *that is being shared* to whatever you want to use.

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 9 months ago #46706 by pawan.m
Thanks Alex,
SCOpenGraph and SCSocialWidget are working fine on setting the properties on particular page.

I also need to use SCSocialWidget to share over LinkedIn, however the admin interface restricts the module to a single provider.
Can we provide for share over multiple social networks: Facebook and LinkedIn?

Best wishes,
Pawan.
The topic has been locked.
Support Specialist
11 years 9 months ago #46711 by alzander
If you're just using share buttons, use the JFBCSocialShare widget. That can let you configure any of the like buttons we offer in one module. It's what's used on the bottom right of this site in it's floating mode.

I hope that helps,
Alex
The topic has been locked.