Topic-icon Facebook Share Button not rendering in AJAX with JomSocial

Active Subscriptions:

None
Hi,

I'm trying to add a share button to every activities in JomSocial, the button is rendering fine on the first page, but once I reach the bottom of the page and the next activities are being loaded I only see the tag in text and no button is rendered.
Do you know any workaround, or maybe a more clean integration ?

Regards.
The topic has been locked.
Support Specialist
In general, we don't recommend adding the share button to each activity in JomSocial. The share feature works by sharing a specific URL and the activities in the JomSocial stream don't all have a unique URL that can actually be shared. That means that, when shared, users will be sent to the activity listing and not any specific item of activity, which can be confusing and won't be related to any message/comment that was used when shared.

With that said, it sounds like JomSocial is doing AJAX requests to fetch extra activity items to show. If that's the case, the JFBCSystem plugin is likely not being triggered to replace the {JFBCLike} tag that you're adding. Is that what you're seeing (the JFBCLike tag) or are you seeing something else? If you want to keep trying with the share, let us know what you're inserting and what's happening, and we'll try to help get you going.. but again, I'd recommend testing the share buttons you already have to make sure they do what you want them to do.

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

None
9 years 3 weeks ago - 9 years 3 weeks ago #52262 by rmis
Thanks for your answer, about the activity I had the problem with the unique URL so I ended up only doing the share button for the event but that's right I only have the tag which is displayed.
Here is what I'm using in the template :

{JFBCShare href=<?php echo $this->event->getLink(); ?> layout=button}

so it works for the first one, but then I just have the text version of the tag with the share url
Last edit: 9 years 3 weeks ago by rmis.
The topic has been locked.
Support Specialist
As noted above, the easy-tags aren't being rendered because the AJAX isn't calling them. We'll have to try to work through this in a few steps. The first is to use the following raw HTML instead of the tag in the template:
<div class="fb-share-button" data-href="<?php echo $this->event->getLink(); ?>" data-layout="button_count"></div>
My guess is that this will insert the proper HTML into your page, but the button will not display (nothing will). In that case, another small amount of Javascript will need to be executed each time 'new' activity is shown:
FB.XFBML.parse();
The problem is that I don't know where to put that since it will have to execute after a JomSocial call. You may need to contact the JomSocial developers to determine how to hook into their Ajax request the best to add that code after the new HTML (the activity + share button) is inserted into the page.

I hope that helps explain, but if you have any other questions, just let me know.

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

None
9 years 3 weeks ago #52299 by rmis
Great, Thanks for your quick help. I will see with them if they now how to do that.

Regards,
Pierre
The topic has been locked.