Facebook like

Permalink
Hello.

Im having some problems with the facebook like buttton.

im using this one:

https://developers.facebook.com/docs/reference/plugins/like/...

but this only make people like the root of my page. (or what ever link i put in on the create code site, BUT i need it to use the url from which the like button is placed)

I want the code you can use on ex. blog post - so that if you click the like button, you only like the blog post and not the entire site everytime... So if i post somethin about wellness and then next time about hard work, then i should be able to like both of them... Makes sense?

Basicly everytime i add a blogpost i want a like button for each post.

 
JohntheFish replied on at Permalink Reply
JohntheFish
berteldk replied on at Permalink Reply
I hear you and i have looked at these... But i need the code so i can add it into the view.php. Also arent those add-ons dependent on api keys or something? That require my clients to have a fb page for their company right? They dont have this yet and prolly wont for some time, they only need people to like their posts.

But im pretty sure there is a code out there that will simply take the url the button is placed on and post that link on your wall if you push like...

Argh annoying i cant find it anywhere.
MysteriousCleon replied on at Permalink Reply
MysteriousCleon
I don't have time now, to try to set it up, but maybe it will help you:
try to add instead of URL in ILike plugin:
<div class="fb-like" data-href="http://www.your_url.pl" data-send="true" data-width="450" data-show-faces="false"></div>

some method of getting current page url - try to find here:http://www.concrete5.org/community/forums/customizing_c5/trying-to-...
berteldk replied on at Permalink Reply
That didnt work either. Once i click liked in one of them both of my blocks got marked... Thank you thouhg.
MysteriousCleon replied on at Permalink Reply
MysteriousCleon
On one page?
berteldk replied on at Permalink Reply
Yes... I use designer content to add blocks and then i add the code in the view.php file so it appears below my content. But when i click it still marks both my post.

all blogs etc. use this method so im surpriced it so hard to do :( ... example:http://celinealbert.looknow.dk/...

i just cant figure out what code they use?!
MysteriousCleon replied on at Permalink Reply
MysteriousCleon
Yea, now i get it - I didn't read that you need not to like subpage, but post on the page.
So - I think, that you can only "like" some URL, so your posts need to have unique URLs - maybe it is good to use anchors? Somehow you have to add unique anchors - i.e. number posts, or use their headers, then only print this into this code, that you have now...
It should be possible to ad as HTML in designer content some anchor, and then use it in Like block...

Only idea... :)
berteldk replied on at Permalink Reply
Thank you - im not so good with codes yet though so if you would help me out it would be greatly appreciated!!!

So before i can like a unique part of a site it needs a unique URL? How can this be done with anchors? Are you familiar with designer content? If so - can you explain how you might would think this could be possible?

really any help is so much appreciated, it seems a bit hard to figure out?
MysteriousCleon replied on at Permalink Reply
MysteriousCleon
I'm not so good at that eiter - just trying... :)

I think that it would be good to set maybe something like:

<a name="<?php $block->getBlockID()?>"></a>

at the biggining - i.e. in beginning of view.php
then in the code of like button:
<div class="fb-like" data-href="http://www.your_url.pl#<?php $block->getBlockID()?>" 
data-send="true" data-width="450" data-show-faces="false"></div>

is it making any sense?
berteldk replied on at Permalink Reply
Kinda - i think i understand what you want, i will test it tomorrow and see if it works and get back to ya.
berteldk replied on at Permalink Reply
Wont work since its only classes... Everytime i post a designer content block it is in a class and not an id, because it will be posted multiple times...
MysteriousCleon replied on at Permalink Reply
MysteriousCleon
No, you didn't understand. Every time when you add any block, it hs given unique id (it's not in html, so it has nothing to do with html ids or clsses) - this id is in database, and it identyfies every block. For instance, when you move block up or down in area, database know where to show it by its specyfic id.
This id is very unique, so it gave me idea to use it in our case. You can call this id usig code, that I gave you above.
berteldk replied on at Permalink Reply
But i put in the code at the top of my view.php file and then i add the link were i want the button showed and it didnt work. Maybe im doing it wrong, but when i add the code i could only see one block on the page, rest dissapeared ... ?
MysteriousCleon replied on at Permalink Reply
MysteriousCleon
Hmmm... i don't know, I'll try do do it in the evening if only have some time.
Of course - maybe it is impossible... :)
berteldk replied on at Permalink Reply
your the best... thanks a lot! Cant wait to see if you can do it...
MysteriousCleon replied on at Permalink Reply
MysteriousCleon
I'm sorry, but i tried, and can't do that either... I had an idea, but something goes wrong - maybe someone smarter would try - we have many brilliant people in this forum...
berteldk replied on at Permalink Reply
Yea we can hope they will find the way to this thread then! Thank you for your time though, it is very much appreciated.