fritzmg/contao-facebook-gallery
Composer 安装命令:
composer require fritzmg/contao-facebook-gallery
包简介
Contao extension to integrate a public Facebook album just like a regular Contao gallery.
README 文档
README
Contao Facebook Gallery
Simple extension to allow the integration of a Facebook album via a gallery content element.
Usage
Facebook app
In order to be able to use the content element, you need to create a Facebook app first. Then you can define the Facebook app ID and App Secret in the system settings of Contao, or in the page root settings.
Album ID
Within the content element, you can simply provide the URL to the Facebook album, or its Facebook ID. If you provide the URL to the album, the album ID will be automatically extracted from the URL, if possible.
Access token
Important: due to changes in Facebook's API in 2018 you can no longer access public albums of pages without a valid access token. Otherwise you would have to submit the Page Public Content Access app permission for review.
Thus since version 1.5.0 you have the ability to set a Facebook access token for each album. You can use this tutorial for example on how to create a Facebook Page access token that never expires. The basic steps are:
- Create a user access token for your Facebook app within Facebook's Graph Explorer. Important: you must require the
manage_pagesand thepublish_pagespermission. Otherwise you will be unable to generate an access token that never expires. - Debug and extend the access token in Facebook's Access Token Debugger.
- Use the new access token in the Graph Explorer to make a query on
/me/accounts. - Copy the access token for the page from which you want to pull the album from and insert it into the content element.
Note: the Facebook user with which you create this access token must be administrator or developer of the Facebook app and he must be able to manage the album's Facebook page.
Image size
You can also define an image width and/or height (the image size mode will be ignored) - however, this will not be exact. Facebook (usually) provides differently sized images for each image of the album - the content element will try to find the smallest image that is at least as large as the given width and/or height. Thus you'll probably have to resize the images via CSS, to fit in your layout. Or change the gallery_default template and hardcode the given size as an inline style.
Additionally, a srcset from the available resolutions for each image will be created.
Sorting options
Since version 1.4.0 there is a sorting setting. Keep in mind that sorting by ID will only work on systems that use a 64-bit PHP environment, due to the large Facebook IDs.
Template data
For each image of the gallery, there is additional data available via $col->fbData. For example $col->fbData->id contains the Facebook ID of the image and $col->fbData->album->name contains the Facebook album's name. Since version 1.5.0 the Facebook data also contains the Facebook link of the image.
Notes
- Due to a lack of implementation within the Graph API of Facebook, public albums from Facebook groups cannot be displayed.
- Currently, the images are always linked directly from Facebook and will not be cached locally.
- The Facebook Graph API data is cached locally and can be purged in the system maintenance.
Acknowledgements
Development funded by Kosmopiloten.
fritzmg/contao-facebook-gallery 适用场景与选型建议
fritzmg/contao-facebook-gallery 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 131 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 05 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「facebook」 「gallery」 「contao」 「Album」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fritzmg/contao-facebook-gallery 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fritzmg/contao-facebook-gallery 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fritzmg/contao-facebook-gallery 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Contao Open Source CMS
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
A module for the SilverStripe CMS which allows you to organize images in a gallery format.
Creates a basic photo gallery pagetype with albums and photos. Photos within albums are opened with a lightbox.
Quick gallery content block for Silverstripe CMS
统计信息
- 总下载量: 131
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2015-05-04