zaengle/craft-sharingintents
最新稳定版本:5.1.2
Composer 安装命令:
composer require zaengle/craft-sharingintents
包简介
Generate social sharing intent URLs
README 文档
README
Generate social sharing intent URLs
Requirements
This plugin requires Craft CMS 5.0.0-beta.6 or later.
Installation
cd /path/to/project
composer require zaengle/sharing-intents
./craft plugin/install sharing-intents
Sharing Intents Overview
Generate sharing URLs using web intents
Current providers:
- Twitter / X
Configuring Sharing Intents
Zero config :)
Using Sharing Intents
Templating uses craft.sharingIntents which has 3 methods:
facebook(), twitter(), linkedIn()
all three take the same params:
url <string> URL to share
description <?string> optional description (only supported for twitter ATM, other providers won't break, it just won't affect the)
extraParams <?array> K/V string pairs of other params to append to the url
{# get an intent URL #} {{ craft.sharingIntents.facebook(entry.url) }} https://www.facebook.com/sharer/sharer.php?u=https%3A//zaengle.com/blog/making-it-work-and-doing-it-right {# pass an optional description (only supported for twitter ATM) #} {{ craft.sharingIntents.twitter(entry.url, entry.description) }} https://twitter.com/intent/tweet?url=https%3A//zaengle.com/blog/making-it-work-and-doing-it-right&text=My+awesome+title {# arbitrary params! #} {{ craft.sharingIntents.linkedIn(entry.url, null, { foo: 'bar' }) }} https://www.linkedin.com/shareArticle?url=https%3A//zaengle.com/blog/making-it-work-and-doing-it-right&foo=bar
Sharing Intents Roadmap
- Release it
- Add more providers
Brought to you by Zaengle Corp
统计信息
- 总下载量: 5.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-26