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
Requires
- php: >=8.3
- composer/installers: *
- silverstripe/cms: ^5 || ^6
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
-
Place the module in your SilverStripe project under
sociallinks/. -
Run
composer installif required. -
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
-
Run
/dev/build?flushin 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
platformsarray in your config and run/dev/build?flush. - If you add new platforms, run
/dev/build?flushto create default records.
License
MIT