tks
tks

Reputation: 753

treating multiple URLs as a single 'like' object for fb like button

I am working on a site with a custom CMS that generates URLs based on article titles. The problem being faced by the site contributors is that when they update a title of an article it generates a new URL for the article so all the previous 'likes' of the article are associated with the old URL (where a copy of the article is still viewable) and the new one doesn't have any likes. Is there any way to implement Facebook likes so that two different URLs share the same pool of likes -- so therefore the likes of the old URL will transfer over to the new URL and if a like button is pressed on either URL it contributes to their common pool of likes? Any other suggestions for getting around this limitation?

Upvotes: 1

Views: 129

Answers (1)

Tobias Krogh
Tobias Krogh

Reputation: 3932

why don't you use concatenated URLs? like

/url-generated-from-title-id

where id holds a static ID of the article in your database? you can always strip this last part with simple JavaScript

var pathParts  = location.pathname.split("/"),
    identifier = pathParts[pathParts.length-1].split("-"),
    articleId  = identifier[identifier.length-1]; // holds "id"

the title can still change but the id won't

Upvotes: 1

Related Questions