betterembed/neos-betterembed 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

betterembed/neos-betterembed

Composer 安装命令:

composer require betterembed/neos-betterembed

包简介

BetterEmbed integration for Neos CMS

README 文档

README

Latest stable version Total downloads License

BetterEmbed integration for Neos CMS

BetterEmbed is a free service to easily integrate content like Twitter posts, blog posts, or any other kind of remote content.

Notice: Due GDPR consent access gateways, not every URL will work. For instance there are known issues with Facebook, and Instagram.

Benefits of BetterEmbed

  • easily integrate external content
  • improve privacy by keeping out unwanted tracking cookies (GDPR)
  • increase page speed by not loading external Javascript and CSS resources

If you want to know more, please visit https://betterembed.com to see the full feature list and get more information about the project.

Installation

Add the dependency to your site package like this:

composer require --no-update betterembed/neos-betterembed

And then run composer update in your project's root folder.

Dependencies

This package currently only requires Neos >= 8 and guzzlehttp/guzzle

Usage

BetterEmbed content element

BetterEmbed Placeholder

Examples

Website Example

BetterEmbed example blog post

API result
{
    "url": "https://www.theverge.com/2020/3/23/21175407/remote-work-working-from-home-guide-how-to-tips-video-conference-calls-laptops-zoom-slack",
    "itemType": "The Verge",
    "title": "The Verge Guide to Working at Home",
    "body": "Tips and tricks on being a remote worker",
    "thumbnailUrl": "https://cdn.vox-cdn.com/thumbor/NdRt13PSWplEE-lZkxFEPyc4a8U=/0x146:2040x1214/fit-in/1200x630/cdn.vox-cdn.com/uploads/chorus_asset/file/19822359/acastro_200319_3941_wfhGuide_0003.jpg",
    "authorName": "Barbara Krasnoff",
    "publishedAt": "2020-03-23T08:00:00-04:00"
}

YouTube Example

BetterEmbed example Youtube 1 BetterEmbed example Youtube 2 BetterEmbed example Youtube 3

API result
{
    "embedHtml": "<iframe width=\"480\" height=\"270\" src=\"https://www.youtube.com/embed/-ZHY85m63k0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>",
    "url": "https://www.youtube.com/watch?v=-ZHY85m63k0",
    "itemType": "YouTube",
    "title": "Neos Con 2019 Teaser Trailer | Neos Conference",
    "body": "Only a few weeks and tickets left till the Neos Con 2019 in Dresden from 10th to 11th May. Be sure to save your spot: https://www.eventbrite.de/e/neos-confer...",
    "thumbnailUrl": "https://i.ytimg.com/vi/-ZHY85m63k0/hqdefault.jpg",
    "authorName": "Neos CMS",
    "authorUrl": "https://www.youtube.com/channel/UCQndryIh2s9i3htDrpb6tiw",
    "publishedAt": "2019-03-29T00:00:00+00:00"
}

Twitter Example

BetterEmbed example Twitter 1 BetterEmbed example Twitter 2 BetterEmbed example Twitter 3

{
    "embedHtml": "<blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">What a blast! ☺️ Two days full of exciting talks, conversations, networking and way more! Thank you all for being part of it! We hope to see you all again soon! 🥰 <a href=\"https://twitter.com/hashtag/neoscon?src=hash&amp;ref_src=twsrc%5Etfw\">#neoscon</a> <a href=\"https://twitter.com/hashtag/neos?src=hash&amp;ref_src=twsrc%5Etfw\">#neos</a> <a href=\"https://twitter.com/hashtag/community?src=hash&amp;ref_src=twsrc%5Etfw\">#community</a> <a href=\"https://t.co/nSaZCU2bba\">pic.twitter.com/nSaZCU2bba</a></p>&mdash; The Neos Project (@neoscms) <a href=\"https://twitter.com/neoscms/status/1127605365019947008?ref_src=twsrc%5Etfw\">May 12, 2019</a></blockquote>\n<script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>",
    "url": "https://twitter.com/neoscms/status/1127605365019947008",
    "itemType": "Twitter",
    "title": "The Neos Project on Twitter",
    "body": "“What a blast! ☺️ Two days full of exciting talks, conversations, networking and way more! Thank you all for being part of it! We hope to see you all again soon! 🥰 #neoscon #neos #community”",
    "thumbnailUrl": "https://pbs.twimg.com/media/D6YN2puXkAE_QLr.jpg:large",
    "authorName": "The Neos Project",
    "authorUrl": "https://twitter.com/neoscms",
    "publishedAt": "2019-05-12T16:04:03+00:00"
}

Rendering

The package includes a default rendering component together with the according Javascript and CSS sources.

Use your own renderer

You can easily register your own rendering component via extending BetterEmbed.NeosEmbed:Component.Renderer:

prototype(BetterEmbed.NeosEmbed:Component.Renderer) < prototype(Neos.Fusion:Case) {
    yourComponent {
        condition = true
        renderer = Your.Component:BetterEmbed {
            @apply.props = ${props}
        }
    }
}

Asset handling

You will find the imported assets in the "BetterEmbed" asset collection within the Neos CMS Media Module. Each asset will be tagged with the itemType of the BetterEmbed response record for further grouping.

BetterEmbed media module

API

The package is based on the BetterEmbed API endpoint. You can read the API description here and test URLs.

Issues and PRs

Feel free to create issues for PRs if you like.

betterembed/neos-betterembed 适用场景与选型建议

betterembed/neos-betterembed 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.16k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2020 年 02 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 betterembed/neos-betterembed 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 betterembed/neos-betterembed 我们能提供哪些服务?
定制开发 / 二次开发

基于 betterembed/neos-betterembed 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 4
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2020-02-13