Topic-icon Changing content on photo_upload action?

10 years 7 months ago #36867 by chramb1
I set up the photo_upload action by making an object and an action and accepted all of the defaults. This works - when a photo is uploaded, the action shows up on my Facebook page, but I don't like the output. Specifically, if the user doesn't give the photo a title, the text that goes with it looks like:

Christopher Ambler's photos - Christopher Ambler's Gallery
Christopher Ambler's Gallery

The top line is a hot link to www.rockyhorror.org/photos/cambler/album...urce=other_multiline

So it links to the gallery - but this text could be better. Where is it generated? I'd love to be able to change the code in the /plugins/opengraph/jomsocial/jomsocial.php file, where I presume this is all set up, to make this a bit better.

Specifically, removing the "Christopher Ambler's photos -" from the link and turning the second "Christopher Ambler's Gallery" into the gallery description instead of duplicating the name.

Yes?
The topic has been locked.
Support Specialist
10 years 7 months ago #36918 by alzander
Chris,
The Open Graph - JomSocial plugin is where to look. The issue is with the og:title and og:description tags being set. The og:description tag is set to the album name with the following code, around line 107:
$this->addOpenGraphTag('description', $album->name, false);
Update that however you want for the description. The og:title is simply using the title for the page. You could add a new title for albums with the following line directly under the line above:
$this->addOpenGraphTag('title', "My album title", false);
I hope that gets you started, but if you have any questions, just let me know.

Thanks,
Alex
The topic has been locked.
10 years 6 months ago #36982 by chramb1
Perfect - are these changes on my part likely to get clobbered on an upgrade?
The topic has been locked.
Support Specialist
10 years 6 months ago #36998 by alzander
Yup, unfortunately it will be overwritten on upgrade.

If there's something you're setting as the title that seems like a good generic title we should set on all sites, let us know. If you are setting the title to a fixed value for all galleries, there's actually another way we could probably help you implement that that wouldn't be overwritten.

We do have the v5.1.2 release coming out next week that will overwrite these changes. After that, we're hoping to get back to a much more stable cycle. v5.0 came out in February and there wasn't a v5.0.1 until July. The idea is to have a major version every 3'ish months and no bug-fix releases, but v5.1 just added so much there were a few more issues than normal. Ideally, we won't have 1-2 new releases every month, like has been happening the last few.

I hope that helps,
Alex
The topic has been locked.
10 years 6 months ago #37019 by chramb1
Here's the problem - the action is for when a photo is uploaded to a gallery, but there is no concept of the photo at all. The title and description are both for the gallery, which makes Facebook simply say that the user uploaded to "{title} - {description}" which is often, based on how the user names things, confusing.

What would make a LOT more sense is if it was that the user uploaded {name-of-photo} to their gallery, {name-of-gallery}, and put that in description. Title, then, should be something more generic like the fact that the user uploaded a photo.

When creating the event on Facebook, I used the object type of "photo" and the action of "upload" and then put the title of the photo in the title field. If the user has no title (they can upload blank), it uses the generic, "a photo."

But making it JUST the gallery in the data makes for confusing link text.

Does this make sense?
The topic has been locked.
Support Specialist
10 years 6 months ago #37023 by alzander
Chris,
Yes it does make sense. It also reminds me of why it was setup like that. When we initially launched Open Graph plugins around the beginning of this year, JomSocial had a bad URL scheme for showing images in that you could not link directly to any image. They fixed that in 2.8 (I think) and it's definitely right in 3.0.

It's likely that we need to investigate and update our code to link directly to the image, which is now possible, instead of the album as we had to do before.

Let me get back to you on this and see what I can do. It may take a few days to get a response, but hopefully we'll have a better solution for what you're doing.

Thanks,
Alex
The topic has been locked.
10 years 6 months ago #37066 by chramb1
Cool - now that JS supports it, the per-photo focus is likely a significant improvement over just noting the gallery. And being able to set the image to the photo is almost necessary in such a situation.

What would be ideal is likely something you can't do though - the "share on facebook" checkbox when uploading. But that's JomSocial core code.

Now, that said, it's something I'll likely code-in as a template override in JomSocial. I can add the share option, default the checkbox based on the user's preference from your component, and then sniff that value when your open graph action is triggered.

This would let me then re-submit the action to Facebook as implicitly shared, something I'd really like to have ;)

If I do this, I'll toss you the code in the override. It's likely something you don't want to support (or should!) but getting it out there simply as a documented example would be helpful to others who want to do it.

Getting your open graph action to be per-photo is first, though.
The topic has been locked.