Me too, like you and some other people, I was looking for a solution to share the events on the socials, but we cannot blame the fantastic crew of JEM that give us, for free
, a component very complete, well done and supported better than a commercial one, when they don’t give us solutions for our personal stuffs.
It’s true, in this times the social connections are important but is not JEM that miss the integration, are the social plugins and components that are not ready for JEM and maybe you have to contact the producer of JFBConnect for to ask such of integration.
I don’t know components that are “social integrated” itself, must always to install third part extensions for that.
Anyway, here is, a complete and ease solution without using components, plugin or hack the core of joomla, but you need to “get your hands dirty !” and hack a little bit the core of JEM.
I did it in the (old….) JEM 3 but it should work also in JEM 2xx
So, first, download and install a module that render the share buttons
(if you have already JBConnect you can try the step “B” only, and see if work – I don’t know that extension)
personally I use this little and free module: ITPsocialbutton itprism.com/free-joomla-extensions/socia.../multi-share-buttons
however you can use what module you want and is needed only the module not the plugin!
Open it, give it a name (eg: socialbuttons), activate the buttons (Facebook, Google+ and Tweeter), and publish it
Do NOT assign a position or a menu item
Now the trick part, You have to:
(I recommend to do the following steps in an override file for not to lose all at the next JEM upgrade)
A – Call the module inside the view of the event details to render the buttons
B - Put the appropriate meta inside the <head> </head> of the event page
So, go to: components/com_jem/view/tmpl/default.php and open it
A - Add the module where you want to render the buttons in the event page with this :
$module = &JModuleHelper::getModule('socialbuttons');
(eg: if you want to see the “social buttons” before the description find <!-- DESCRIPTION --> and add the code just before it )
B – Add the social meta (Facebook Twitter and Google+)
in the same file (default.php) at the beginig (after the jhtml stuff and before the php’s close ?> ) :
// beginig social tags
$socialimage = JUri::base().$this->item->datimage; // path of the event image
// the following is for to check if there is an image on the event and maybe is not needed in JEM 2.xx - I don’t know -
$socialnoimage = JURI::base(true).'/media/com_jem/images/noimage.jpg'; // noimage path - look inside the folder if you have such image.
if ($this->dimage) : // if we have an image
$socimg = $socialimage;
elseif (empty($this->dimage)): // if not
$socimg = $socialnoimage;
// add the tags inside the <head>
$socialtext = strip_tags($this->item->text); // description cleaned
$document = JFactory::getDocument();
<meta property="og:image" content="'.$socimg.'"/>
<meta property="og:title" content="'.$this->escape($this->item->title).'"/>
<meta property="og:description" content="'. mb_strimwidth($this->escape( $socialtext ), 0,180, ".....").'"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:image" content="'.$socimg.'"/>
<meta name="twitter:title" content="'.$this->escape($this->item->title).'"/>
<meta name="twitter:description" content="'. mb_strimwidth($this->escape( $socialtext ), 0,180, ".....").'"/>
That’s it, now in every event page you have the social share integration that share the correct event data on the socials