toastnz/sociallinks

Silverstripe social links module

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

pkg:composer/toastnz/sociallinks

1.0 2025-10-22 23:28 UTC

This package is auto-updated.

Last update: 2025-10-22 23:29:21 UTC


README

This module provides a way to manage social media links in SilverStripe via SiteConfig. It allows add and sort social links for their website.

Features

  • Define supported social platforms via YAML config
  • Automatically create default social link records for each platform
  • Manage social links in SiteConfig with a sortable grid field
  • Prevent deletion of links for platforms defined in config
  • Easily extendable for additional fields or platforms

Installation

  1. Place the module in your SilverStripe project under sociallinks/.

  2. Run composer install if required.

  3. Add your desired platforms to a yml config file, e.g., app/_config/sociallinks.yml:

    Toast\SocialLinks\Models\SocialLink:
      platforms:
        - x
        - facebook
        - instagram
        - linkedin
        - youtube
        - pinterest
  4. Run /dev/build?flush in your browser.

Usage

  • Go to Settings > Social Links in the SilverStripe CMS.
  • Add or edit links for each platform.
  • Drag to reorder links.
  • Platforms listed in the config will be protected from deletion.
  • Platforms cannot be added manually, they must be defined in the config.

Extending

You can extend the SocialLink model or the SiteConfigSocialExtension to add more fields or customize behavior.

Troubleshooting

  • If you cannot delete a social link, ensure it is not listed in the platforms array in your config and run /dev/build?flush.
  • If you add new platforms, run /dev/build?flush to create default records.

License

MIT