Package: hexagonit.socialbutton
This package provides viewlet to embed social button to Plone site.
The viewlet can be assigned to wherever viewlet managers through the web.
Since restrictions for the embedded code are not set,
you need to be cautious about the security risk with the embedding code.Further Documentation URLhttp://packages.python.org/hexagonit.socialbutton/Repository URLhttps://github.com/hexagonit/hexagonit.socialbutton/ConfigurationOnce the package is installed throughSite SetupAdd-ons, there appearsSocial Button Code SettingandSocial Button Configurationlinks within theAdd-on Configurationsection.To start the configuration, go toSocial Button Code Settingfirst to set the embedding code.Social Button Code SettingIDThe ID will be used for farther configuration and styling.CodeThe code to be embedded to viewlet.Example to set values from file system code:registry = getUtility(IRegistry)
registry['hexagonit.socialbutton.codes'] = {
    u'facebook': {
        u'code_text': u'<FACEBOOK>${title} <img src="${portal_url}/++resource++hexagonit.socialbutton/facebook.gif" /></FACEBOOK>',
    }
}Example to register through registry.xml:<record name="hexagonit.socialbutton.codes">
  <field type="plone.registry.field.Dict">
    <title>Codes for Social Buttons</title>
    <key_type type="plone.registry.field.TextLine" />
    <value_type type="plone.registry.field.Dict">
      <title>Value list</title>
      <key_type type="plone.registry.field.TextLine" />
      <value_type type="plone.registry.field.Text">
        <title>Values</title>
      </value_type>
    </value_type>
  </field>
  <value>
    <element key="facebook">
      <element key="code_text">&lt;FACEBOOK&gt;${title} &lt;img src="${portal_url}/++resource++hexagonit.socialbutton/facebook.gif" /&gt;&lt;/FACEBOOK&gt;s</element>
    </element>
  </value>
</record>Code variables${title}Title of the context.${description}Description of the context.${url}URL for the context${lang}Language in use like en.${lang_country}Locales including country code such as en_US.${portal_url}Plone site root URL.OnceSocial Button Code Settingis set, you can go toSocial Button Configurationfor the farther configuration.Social Button ConfigurationIDThe ID set atSocial Button Code Setting.Content TypesThe content types where the viewlet will be applied.Viewlet ManagerAdd the names of viewlet managers line by line where the viewlet will be applied.View ModelsAdd the names of views where the viewlet will be applied.
For all the views, use*.View permission onlyIf checked, the viewlet is only available at view which are available to anonymous users,
like in most cases for published contents.EnabledUncheck this option, when disabling the code from the viewlet.Example to set values from file system code:registry = getUtility(IRegistry)
registry['hexagonit.socialbutton.config'] = {
    u'facebook': {
        u'content_types': u'Page,News Item',
        u'viewlet_manager': u'plone.abovecontent\nplone.belowcontent',
        u'view_models': u'*',
        u'view_permission_only': 'True',
        u'enabled': 'True',
    }
}Example to register through registry.xml:<record name="hexagonit.socialbutton.config">
    <field type="plone.registry.field.Dict">
      <title>Configuration for Social Buttons</title>
      <key_type type="plone.registry.field.TextLine" />
      <value_type type="plone.registry.field.Dict">
        <title>Value list</title>
        <key_type type="plone.registry.field.TextLine" />
        <value_type type="plone.registry.field.Text">
          <title>Values</title>
        </value_type>
      </value_type>
    </field>
    <value>
      <element key="facebook">
        <element key="content_types">Page,News Item</element>
        <element key="viewlet_manager">plone.abovecontent
plone.belowcontent</element>
        <element key="view_models">*</element>
        <element key="view_permission_only">True</element>
        <element key="enabled">True</element>
      </element>
    </value>
  </record>Change log0.11 (2014-05-13)Get rid of portal_url. [taito]Need plone.stringinterp>=1.0.11. [taito]0.10.2 (2013-11-12)Bug fix for context which does not have type info. [taito]0.10.1 (2013-08-08)Fix test. [taito]0.10 (2013-05-01)Remove dependency from five.grok. [taito]Integrate Travis CI. [taito]Move test packages to extras_require. [taito]0.9 (2012-11-13)Add permission:hexagonit.socialbutton: Manage Social Buttonto manage social button. [taito]0.8.1 (2012-09-28)Fix bug for multiple line code. [rnd, taito]0.8 (2012-09-20)Add dependency to Plone>=4.2.1 and removed dependency to plone.stringinterp>=1.0.7 since Plone-4.2.1 includes it.
[taito]0.7 (2012-08-22)Dependency to plone.stringinterp>=1.0.7 added to make string interpolation available
in the context of Plone Site root.
[taito]0.6 (2012-08-21)Add guards for cases of None to the upgrade step [rnd]0.5 (2012-08-17)Update registry.xml to enable import and export. [taito]Switch to use plone.stringinterp instead of format method
for string interpolation in embedding codes.
[taito]0.4 (2012-08-13)Fixing typo. Po-files initialized. Some translations. [rnd]Fixing the problem with some views: guarding the viewlet [rnd]google-plus image added [taito]0.3 (2012-08-08)Add class for styling against viewlet managers. [rnd]0.2 (2012-08-02)Uninstall profile to remove registry records added. [taito]UnicodeDecodeError for context title and description fixed for the viewlet. [taito]Add ‘Plone Site’ to the configurable content types. [taito]0.1 (2012-07-31)Initial release for use. [taito]0.0 (2012-07-24)Initial release. [taito]ContributorsKai Lautaportti <kai.lautaportti at hexagonit.fi>Roman Susi <roman.susi at hexagonit.fi>Taito Horiuchi <taito.horiuchi at gmail.com>