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 show the links in the footer

Contents

  • With Volto Light Theme
  • With another theme
  • Somewhere else on the page
  • Only some networks, or in another order

How to show the links in the footer#

This guide shows you how to render a site's social links outside a Follow Us block: in the footer, or in another part of the page.

With Volto Light Theme#

There is nothing to do. Volto Light Theme renders the followUs slot in its footer whenever the page has links, and the add-on registers the icons in that slot.

With another theme#

Render FooterLinks in the component that renders your footer.

import FooterLinks from '@plonegovbr/volto-social-media/components/FooterLinks/FooterLinks';

const Footer = () => (
  <footer>
    <FooterLinks title="Follow us" />
  </footer>
);

export default Footer;

FooterLinks shows the links the page inherits, under an optional headline. Pass animate={false} to keep the icons still.

Somewhere else on the page#

Register the add-on's FollowUs component in a slot of your choice, in your add-on's configuration. This puts the icons below the content of every page.

import type { ConfigType } from '@plone/registry';
import FollowUs from '@plonegovbr/volto-social-media/components/slots/FollowUs';

export default function applyConfig(config: ConfigType) {
  config.registerSlotComponent({
    name: 'SocialLinksBelowContent',
    slot: 'belowContent',
    component: FollowUs,
  });
  return config;
}

Only some networks, or in another order#

Build the list with useNetworks, and render it with SocialNetworks.

import { useNetworks } from '@plonegovbr/volto-social-media/hooks/useNetworks';
import SocialNetworks from '@plonegovbr/volto-social-media/components/SocialNetworks/SocialNetworks';

const NETWORKS = [{ id: 'mastodon' }, { id: 'github' }];

const DeveloperLinks = () => {
  const networks = useNetworks(NETWORKS);
  return <SocialNetworks networks={networks} animate={false} />;
};

export default DeveloperLinks;

Declare the list of networks outside the component, so its identity stays the same between renders. A network with no link on the site is left out.

See also

Slots and the components and hooks in Volto add-on.

previous

How to add a Follow Us block

next

How to add or change a network

Contents
  • With Volto Light Theme
  • With another theme
  • Somewhere else on the page
  • Only some networks, or in another order

By PloneGov-BR

  • GitHub