承接 stevenpaw/silverstripe-sociallink 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stevenpaw/silverstripe-sociallink

Composer 安装命令:

composer require stevenpaw/silverstripe-sociallink

包简介

A small module for adding social links to silverstripe linkfields

README 文档

README

A Silverstripe 6+ module that adds a Social Media Link type to silverstripe/linkfield. Editors can pick a social platform from a searchable dropdown and enter the profile URL. Platform icons are self-hosted SVGs (DSGVO-compliant, no external CDN).

Requirements

  • PHP 8.3+
  • Silverstripe CMS 6.1+
  • silverstripe/linkfield 5+

Installation

composer require stevenpaw/silverstripe-sociallink

After installing, run a dev/build to create the database table and seed the platform records:

/dev/build?flush=1

Usage

In the CMS

SocialLink is automatically available as a link type in any LinkField. Editors select a platform from the searchable dropdown and enter the profile URL.

In templates

Check whether the current link is a SocialLink by testing $SocialPlatform.exists. The SocialPlatform object provides two helper methods:

Inline SVG (recommended — no HTTP request, inherits CSS color):

<a href="$Link" target="_blank">
    <% if $SocialPlatform.exists %>
        <span aria-hidden="true">$SocialPlatform.IconSVG</span>
    <% end_if %>
    $Title
</a>

Public URL (for use in <img> or CSS background-image):

<% if $SocialPlatform.exists %>
    <img src="$SocialPlatform.IconUrl" alt="$SocialPlatform.Title" width="24" height="24">
<% end_if %>

Platform key (e.g. instagram, youtube) for custom logic or CSS classes:

<% if $SocialPlatform.exists %>
    <span class="icon icon--$SocialPlatform.Key">...</span>
<% end_if %>

Or in PHP:

$platformKey = $link->getPlatform(); // e.g. 'instagram'

Supported platforms

46 platforms are seeded automatically on dev/build:

Apple Music, Atlassian, Bandcamp, Behance, Bluesky, Dailymotion, Deezer, Discord, Dribbble, Facebook, Flickr, GitHub, GitLab, Instagram, KakaoTalk, LINE, LinkedIn, Medium, Microsoft Teams, Mixcloud, Odnoklassniki, Patreon, Pinterest, Reddit, ReverbNation, Signal, Skype, Slack, Snapchat, SoundCloud, Spotify, Steam, Telegram, Tidal, TikTok, Twitch, Vimeo, VK, WeChat, Weibo, WhatsApp, X (Twitter), YouTube, YouTube Music, Zoom

Platforms without a matching FontAwesome 6 Brands icon (Deezer, KakaoTalk, ReverbNation, Signal, Tidal, Zoom) fall back to a generic share icon.

If you need a new public platform, please submit an issue on the repository and I will gladly add it.

License

BSD 3-Clause

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-07-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固