Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

SSocialize Installation


Go to End


5 Posts   1676 Views

Avatar
meesto

Community Member, 3 Posts

5 June 2011 at 5:55pm

I am having some issues installing SSocialize. I've downloaded the most recent version, extracted, renamed the directory to be "ssocialize" and have uploaded it to the root of my SS install. I've also run the dev/rebuild process and all looks OK. This is the point where I get stuck.

What am I supposed to enter into my _config.php file to get my blog and other pages to show a share on Facebook and Twitter button?

The installation steps mention a few lines of code, but when I add something like:

SSocialize::these('Blog');

SilverStripe breaks and only shows a blank white page.

I would like to see an example of what I should be using to get this to work. I am just barely able to read code and as such would appreciate seeing a full set of code for identifying a particular part of the site tree, FaceBook and Twitter feed links and a URL shortener.

Thank you for your assistance.

Regards,
Chris

Avatar
tchintchie

Community Member, 63 Posts

6 June 2011 at 1:48am

hi there!

I´m not a pro with those things either but here´s what I added to my _config.php to make it work:

SSocialize::these(array('HomePage', 'Page'));

with these settings I got my facebook button on each page (even on my blog). Not sure what code you need if you only want to put it on specific pages such as the blog e.g. but my guesses are you just replace the 'Homepage', 'Page' with 'Blog' ???

kind regards

Avatar
meesto

Community Member, 3 Posts

6 June 2011 at 8:55am

Thanks for writing me back!

So from what you've written if looks like the names correspond to the names of elements that are found in the theme/template location. So when I use this:

SSocialize::these('Page');
SSocialize::add_to_group(array('facebookShare'));

and modify my Page.ss and BlogEntry.ss templates to include:

<div class="innerpad">
				$Content
				$SSocializeLinkGroup
				$Form
				$PageCommentss
    			</div>

I can see the Facebook Share icon. I don't seem to be able to get Twitter to work though either on it's own or as part of an array. Thanks again for writing back. I hope I can get the rest of this working.

Kind regards,
Chris

Avatar
meesto

Community Member, 3 Posts

6 June 2011 at 12:12pm

OK then, I've sorted this out and it is working now. This is what I needed to use in my _config.php file:

SSocialize::these('Page');
TweetThis::set_short_url_class('BitlyURL');
SSocialize::add_to_group(array('facebookShare', 'TweetThis'));
SSocializeShortURL::set_shortener_params('myAPI_Key', 'myTwitterUserName');

I did not realize from the installation instructions that I needed to declare TweetThis before adding it to the add_to_group call. It is all working fine now. You can see it in action on my brewery web site at http://kererubrewing.co.nz

Regards,
Chris

Avatar
tchintchie

Community Member, 63 Posts

6 June 2011 at 7:22pm

alright :) didn´t know that since I only use the facebook button. will keep it in mind though ;-)