Skip to main content
Ctrl+K

Social Media support for Plone

Tutorials

  • Tutorials
    • Add social links to a site

How-to guides

  • How-to guides
    • How to install the backend
    • How to install the frontend
    • How to upgrade an existing site
    • How to set the site's links
    • How to give a section its own links
    • How to add links to a content type
    • How to add a social link from Python
    • How to add a Follow Us block
    • How to show the links in the footer
    • How to add or change a network
    • How to style the icons
    • How to troubleshoot

Concepts

  • Concepts
    • Settings that live on content
    • Links and networks

Reference

  • Reference
    • Behaviors
    • Catalog metadata
    • Endpoints and expansions
    • Python helpers
    • GenericSetup profiles
    • Volto add-on
    • Compatibility

Appendices

  • Contributing
  • Glossary
  • Index
  • Repository
  • Suggest edit
  • Open issue
  • .md

How to give a section its own links

Contents

  • Enable the behavior
    • From the control panel
    • From your add-on's profile
  • Set the section's links
  • Verify

How to give a section its own links#

This guide shows you how to let a section of a site, and everything inside it, show links and sharing settings of its own.

A page reads the settings of the closest object that provides the settings behavior. To give a section its own, enable the behavior on the section's content type.

Important

Every item of that content type becomes a source of settings for the content inside it. A new item starts with no links, and its pages show no site links until you set the item's own. If only some folders are sections, give sections a content type of their own.

Enable the behavior#

Enable it from the control panel, or from your add-on's profile.

From the control panel#

  1. Select Site Setup ‣ Content Types, then the section's content type.

  2. In Behaviors, switch on Social Media: Settings.

  3. Select Save.

From your add-on's profile#

Add the behavior to the content type's definition, in profiles/default/types/<Type>.xml, and apply the profile.

<?xml version="1.0" encoding="utf-8"?>
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
        meta_type="Dexterity FTI"
        name="Section"
        i18n:domain="plone"
>
  <property name="behaviors"
            purge="false"
  >
    <element value="plonegovbr.socialmedia.settings" />
  </property>
</object>

Replace Section with the name of your content type.

Set the section's links#

Edit the section, and set its links and sharing settings in its Social Media section, as How to set the site's links shows for the site root.

Verify#

Ask the backend for the settings of a page inside the section.

GET /Plone/department/news?expand=inherit&expand.inherit.behaviors=plonegovbr.socialmedia.settings HTTP/1.1
Accept: application/json

The from of plonegovbr.socialmedia.settings names the section, not the site.

See also

Settings that live on content explains why the closest object wins entirely.

previous

How to set the site's links

next

How to add links to a content type

Contents
  • Enable the behavior
    • From the control panel
    • From your add-on's profile
  • Set the section's links
  • Verify

By PloneGov-BR

  • GitHub