Skip to main content

How do I update my custom theme for Facebook's changes to "like" URLs?

Official response from

NationBuilder's developers regularly update stock themes in response to changes by Facebook, Twitter and other integrated services. On July 10, 2013, Facebook will require social plugins with the "like" button to use absolute URLs. We've updated our stock themes, but if you're using a custom theme, you may need to review your theme and update it to comply with the new Facebook developer guidelines.

Facebook now requires absolute urls so sample.nationbuilder.com will no longer work for the url to be liked. This will work: http://sample.nationbuilder.com (note the added protocol to the url i.e. the 'http://').

In terms of liquid variables, object.full_url must be used instead of object.url.

For example:

{{ site.url }} does not work

{{ site.full_url }}  works

Custom themes are most likely to be affected if built off of the Air, Canvass, or Impression themes. The Facebook changes impacted the _columns_2.html template for those themes.

The specific line that changed looks like:

<fb:like href="{{ site.url }}" width="240" colorscheme="{{ site.facebook_colorscheme }}"></fb:like>

If a customer theme without absolute URLs is not fixed by July 10, 2013, some browsers will show an error where a "like" button should be, with a popup message, "The href URL must be absolute."

Share this post

Showing 5 reactions

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.