Forum for discussing general topics related to Couch.
9 posts Page 1 of 1
Would people be interested in a tag for creating links to share a page/url on social networking platforms?

I have a lightweight one built for my use case at the moment and I'll release that on my blog once it is up and running, however I am interested in knowing if people would be more interested in this feature; all it does is create a new cms tag for outputting popup links to share a page/url on different platforms. It also can fetch the number of shares that URL has on each of the platforms

If there's enough interest and people have more desired platforms for the tag to support, I will happily expand it and add that to the blog.

Currently it only has 5 platforms available: facebook, twitter, google+, linkedin and reddit

The reason I've created this addon (aside from making it easy to output each tag) is that most social networking sites have their own APIs with javascript codes to get share buttons, but these scripts slow down page load speeds A LOT.
Although the share count part of the addon does also create decreased page loading speeds, because it is generated via couch now before the site is loaded, we can couple it with Couches awesome cache feature to mitigate this load speed.

So we get to use cool share buttons with some data for end users to see, without the slow loading times that javascript buttons create!

Do let me know if there's interest in this and which social networking platforms you would like to be supported.

Here is an example of the tag in action: (The icon and styling are my own, you can change most of the markup with ease)

Image
Image
+1 and thank you Barton.
Bartonsweb wrote: Would people be interested in a tag for creating links to share a page/url on social networking platforms?

I have a lightweight one built for my use case at the moment and I'll release that on my blog once it is up and running, however I am interested in knowing if people would be more interested in this feature; all it does is create a new cms tag for outputting popup links to share a page/url on different platforms. It also can fetch the number of shares that URL has on each of the platforms


Sounds like an interesting idea, might be useful on my site too.
+1 interested! :)
+1! I'll even contribute by adding Russian social networks to it.
Thanks everyone for showing interest, I'm a little busy right now but I'll get this on the forums with a guide to it within the next week or 2, it will only have the basic social networks as of right now (as stated in the main post) but again if you want more just let me know, I'm sure you can also add them yourselves later (if you're familiar with PHP). :)
Image
Maybe you'll create a GIT repository for it then? I'm 100% will use it and add networks.
https://github.com/bartonsweb/Couch/tre ... ial-shares

You will also find another addon on my GIT, for Recaptcha. I haven't provided documentation on either of these 2 addons yet, I will do some at some point (I haven't officially finished or released Recaptcha currently, though it works and you can do a lot with it). I will release that one later in a more official manner, but it's there if anybody wishes to take a look at it.

Of course you need to activate the addon in the usual fashion in your addons/kfunctions.php file.

An example usage:
Code: Select all
<cms:share_button url="<cms:show k_page_link />" platform="facebook" show_count="1">Facebook</cms:share_button>


This is used within a page-view, or cms:pages tag. You can use it wherever, though (Just change the url to the full url of the page the tag is on. If you have show_count parameter to 1 the addon outputs the tag as:
Code: Select all
<a href="URLGOESHERE" class="facebook share--link" onclick="window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" target="_blank">Facebook <span class="share--count">0</span></a>

The "onclick" event opens the facebook share box in a popup window.

Hope this helps, feel free to add any platforms you wish (you must find the API urls to fetch their share numbers yourself, though it's usually pretty easy depending on platform.)

I recommend running this addon with couches Cache feature (See: Config file) to minimize outside requests (you will notice a large toll on page load speeds without the cache enabled) However if you have it enabled, only the first cache-save load will be slow. From then until the cache expires, you'll see normal load times.
Image
Thanks! Really glad with this one. I was using the javascript version but this saves a lot of loading time. (a LOT)
9 posts Page 1 of 1
cron