Skip to content

helpfulrobot/sunnysideup-sharethis

 
 

Repository files navigation

Share This

Adds a bunch of social media tricks to your silverstripe website, such as

  • share this page
  • check us out (the website owner) on FB / TWITTER / etc
  • show my latest tweet on my website
  • share FB update on my website etc...

Optional usages of Font Awesome, as recommended by https://github.com/hp7 This still needs to be implemented on the "find us on ... " part.

Developer

Nicolaas Francken [at] sunnysideup.co.nz

Requirements

see composer.json: facebook SDK HIGHLY RECOMMENDED: dataobjectsorter:

Documentation

Please contact author for more details.

Any bug reports and/or feature requests will be looked at in detail.

We are also very happy to provide personalised support for this module in exchange for a small donation.

The facebook RSS link format is like this https://www.facebook.com/feeds/page.php?format=rss20&id= To find the id value, you can follow those steps :

  1. Go to facebook
  2. Find your page (e.g. https://www.facebook.com/EOSAsia)
  3. Note the name (e.g. EOSAsia)
  4. Go to http://findmyfacebookid.com
  5. Enter http://www.facebook.com/EOSAsia
  6. You'll get the answer (e.g. 357864420974239)
  7. The result link is https://www.facebook.com/feeds/page.php?format=rss20&id=357864420974239

EXAMPLE OF HOW TO ADD FB FEED TO Page_Controller

public function FacebookNews() {
	return FacebookFeed_Page::all_for_one_page($this->ID, 5);
}

protected function downloadFaceBookNews() {
	$facebookPages = DataObject::get("FacebookFeed_Page");
	if($facebookPages && $facebookPages->count()) {
		foreach($facebookPages as $facebookPage) {
			$facebookPage->Fetch();
		}
	}
}

function updatefb() {
	if(Permission::check('ADMIN')) {
		$this->downloadFaceBookNews();
		Director::redirect($this->Link());
		return array();
	}
	else {
		return Security::permissionFailure($this, _t('Security.PERMFAILURE',' This page is secured and you need administrator rights to access it. Enter your credentials below and we will send you right along.'));
	}
}

Installation Instructions

  1. Find out how to add modules to SS and add module as per usual.

  2. Review configs and add entries to mysite/_config/config.yml (or similar) as necessary. In the _config/ folder of this module you can usually find some examples of config options (if any).

Add the following to your templates:

<% include ShareThis %>

<% include SocialNetworkingLinks %>

You can also opt to have an additional list of expandable Share This links, using this line in your *.ss file:

<% include ShareAllExpandedList %>

About

adds a bunch of social media tools to your Silverstripe website

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 92.4%
  • Scheme 3.2%
  • CSS 2.5%
  • JavaScript 1.9%