I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Facebook “Like” button plugin for Redmine

This plugin adds the Facebook’s Like, the Twitter’s Tweet and/or the Google’s +1 button to the start page, project overview page, each Wiki page, news pages, versions pages, issues pages and forum topics.

Using

This plugin works just after the installation and does not require any configuration. But, if you want, you can configure the location of buttons and their look and feel using Administration → Plugins → Configure. There you can also disable some or all buttons.

Plugin configuration

  • Buttons can be placed below the main content or into the side bar (except start page, news, versions and forum topics – for these pages buttons are always shown below the main content).
  • The “Width” option for buttons becomes available only when they are put into the main area.
  • The “Show faces” option for the Facebook button becomes available only when this button alone is shown in the main area.
To see how the configuration effects the Facebook’s “Like” button check this Facebook Like button configurator.

Install

  • Copy like directory to:
    • For Redmine 2.x.x and above: #{RAILS_ROOT}/plugins.
    • For older Redmine and ChiliProject: #{RAILS_ROOT}/vendor/plugins.
  • Restart Redmine/ChiliProject.

Upgrade from 0.0.4

Version 0.1.0 changes the internal name of the plugin, therefore, the configration becomes unavailable with the upgrade.

To migrate the configuration to the new version you should:

  • For Redmine 2.x.x and above: rake redmine:plugins:migrate RAILS_ENV=production
  • For older Redmine and ChiliProject: rake db:migrate:plugins RAILS_ENV=production

Upgrade from 0.1.1

Version 1.0.0 changes the structure of the plugin configuration. Without the proper update of this structure the plugin configuration will get malfunction (what can be resolved just by reconfiguring though)!

To migrate the configuration to the new version you should:

  • For Redmine 2.x.x and above: rake redmine:plugins:migrate RAILS_ENV=production
  • For older Redmine and ChiliProject: rake db:migrate:plugins RAILS_ENV=production

Patching news index

To enable the Like button for the news index page (like this one on this site) you need to patch the app/views/news/index.html.erb file manually.

To do this:

  • Copy app/views/news/index.html.erb from the Redmine root directory into app/views/news/ of the plugin's root directory.
  • Add the following line:
    <%= call_hook(:view_news_index_left, :news => news) %>
    
  • After:
    <div class="wiki">
    <%= textilizable(news, :description) %>
    </div>
  • Restart Redmine/ChiliProject.

Using the hook

This way you add the :view_news_index_left hook to the news index page. This hook can also be used for adding other custom content to this page. See this guide on how to do this (it’s for developers).

Meta plugin

Facebook shows the Meta description as the description of the page you have liked. Redmine does not take advantage of the Meta description and always sets it to “Redmine” (see #7983).

Facebook and Google support Open Graph protocol, which they use to get details about the page (see Meta 0.2.0 with Open Graph and Twitter Cards). Twitter supports Twitter Cards, which it uses to embed page details into the tweet _(see Twitter Cards approved!. Both these protocols – Open Graph and Twitter Cards – are not supported by pure Redmine.

So, it is recommended to install the Meta plugin as well (see Wiki of this plugin).

Why is it important?

The following two images show you why is it important:

This was shown on Facebook, if you had not installed the Meta plugin:

This page on Facebook without Meta tags plugin

And this is shown, if you install the Meta plugin:

This page on Facebook with Meta tags plugin

See also

facebook-without-meta.png View - This page on Facebook without Meta tags plugin (11.7 KB) Andriy Lesyuk, 17 Jun 2011 08:09

facebook-with-meta.png View - This page on Facebook with Meta tags plugin (13.3 KB) Andriy Lesyuk, 17 Jun 2011 08:09

like-settings.png View - Plugin configuration (28.7 KB) Andriy Lesyuk, 09 Jun 2014 18:47

Terms of use | Privacy policy