Package: mfabrik.like
IntroductionFeaturesInstallationInstalling the codeEnabling Like-buttonAdding Like box portletPlone 3 and beta componentsExample sitesCustomizationExample of portletRenderer overrideChanging the location of the Like-button viewletSource codeMore informationAuthorChangelog2.0 - 2.11.0 - 2.01.0IntroductionThis Plone CMS add-on product adds the standard Facebook Like-button
and Like boxes to Plone pages.FeaturesThere are several kind of like featuresLike box a.k.a. fan box. Enlists clickers as the fan of your Facebook product page.
This is available as an addable portlet. (This is the modern “Become a fan” button.)Like button allows users to share the current content item URL in their Facebook news feed.
This can be enabled on selected content types or pages using Zope marker interfaces.Other featuresFacebook content is localized by mapping Plone language to Facebook locale (add your own languages tolocales.py)Asynchronous Facebook Connect API Javascript loader is used to optimize the page loading timeInstallationInstalling the codeAdd the following to your buildout.cfg:eggs
        ...
        mfabrik.likeRerun buildout.Restart Plone.Enabling Like-buttonLike-button is enabled on normal Page content type by default.You can edit these settings by goingSite control panel->Facebook Like-button settings.You can also explicitly enable Like-button on some content items by applyingmfabrik.like.interfaces.IFacebookLikeEnablermarker interface on them
through Zope Management Interface.Adding Like box portletAdd Facebook application id toSite control panel->Facebook Like-button settingsFacebook site setup wizardCreate new portletAdd Facebook page id in the portlet settings (this is the long number which you can pick from Facebook page URL)You can get Facebook page id by going to the Facebook product page and check the URL. If there
is a long number then that’s the id. If you don’t see a long number try hovering your mouse
over the product page logo and see if the number is there.Show either full Like box or just “Become a fan” textNoteLike box minimum width is 200 px, recommended by Facebook. The height of bare Become a fan box is 64 px.
With all features on, the height is ~580 px. You can adjust font sizes etc. with your site CSS
as Like box is rendered using Javascript/FBML, not IFRAME, technology.http://wiki.developers.facebook.com/index.php/Like_BoxNoteCurrently Like Box seems to work even without application id, though you should
pass one to Connect API in FB.init() Javascript method.Plone 3 and beta componentsThis add-on product uses software components which are not yet officially deployed
for Plone 3 (and maybe never will) like plone.app.registry. To make these components
work correctly you probably need to use “good-py version pindowns” in your
buildout.cfg.For more information, seehttp://plone.org/products/dexterity/documentation/manual/developer-manual/pre-requisites/buildout-configurationExample sitesSiida - Sami MuseumSaariselka / North Lapland travelCustomizationSubclass viewlet or portlet rendere classesOverride necessary methodsCustomize templateUse a browser layer specific to your customization add-on product to override the default
viewlet / portlet rendererExample of portletRenderer overrideMake sure that mfabrik.like is in buildout eggs before your theme add-onZCML:<include package="mfabrik.like" />

<plone:portletRenderer
        portlet="mfabrik.like.portlets.IFacebookLikeBoxData"
        template="facebook-like.box.pt"
        layer=".interfaces.IThemeSpecific"
        />facebook-like-box.pt example (how to add a header image):<div id="portletFacebook">
    <img tal:attributes="src string:${context/portal_url}/++resource++xxx.app.images/facebookheader.png" alt="Facebook" />
    <div class="content">
        <fb:like-box tal:attributes="profile_id view/getPageId;
                                     stream view/getStream;
                                     header view/getHeader;
                                     height view/getHeight;
                                     width view/getWidth;
                                     logobar view/getLogobar;
                                     connections view/getConnections">
        </fb:like-box>
    </div>
</div>

<p tal:condition="not:view/hasAPIData">
        Please configure Facebook API key and application id
        in the Plone site setup.
</p>Changing the location of the Like-button viewletYou want to do this in your site theming add-on product.Use @@manage-viewlets to hide the default instanceUse ZCML to bind viewlet to a new locationSource codehttp://svn.plone.org/svn/collective/mfabrik.like/trunkMore informationhttp://developers.facebook.com/docs/reference/plugins/likeAuthormFabrik Research Oy- Python and Plone professionals for hire.mFabrik web sitemFabrik mobile siteBlogMore about PloneChangelog2.0 - 2.1Declare quick installer dependency to plone.app.registry [miohtama]Fixed missing <includeDependencies package=”.” /> so that the product does not complain about plone.app.registry ZCMLLike box parametrizes header and stream [miohtama]Like box override example [miohtama]1.0 - 2.0Added control panel to configure [miohtama]Added Like box portlet [miohtama]Added connect.js version [miohtama]Localize Like-button for the current Plone language [miohtama]1.0Initial release