marcel-mathias-nolte / contao-mobile-detection-content
Contao开源内容管理系统MobileContent扩展
10.10.11
2022-01-12 14:33 UTC
Requires
- php: >=7.2
- codefog/contao-haste: ^4.17
- contao-community-alliance/composer-plugin: ~2.4 || ~3.0
- contao/calendar-bundle: ^4.4
- contao/core-bundle: ^4.4
- contao/faq-bundle: ^4.4
- contao/news-bundle: ^4.4
- mobiledetect/mobiledetectlib: 2.*
Conflicts
- contao/core: *
- contao/manager-plugin: <2.0 || >=3.0
- derhaeuptling/contao-mobilecontent: *
README
基于bugbuster/mobiledetection-bundle和derhaeuptling/contao-mobilecontent。由于derhauptlings的包单独使用无法很好地检测移动设备,所以我合并了这两个包的一些功能。
此扩展允许您在移动或桌面设备上显示或隐藏特定的文章、内容元素和前端模块。图像字段已扩展——现在可以为移动设备添加不同的图像。
它通过识别访客的用户代理并显示适当的内容而无需额外配置即可正常工作。
如果您使用CDN缓存页面,可能需要启用单独的移动域名(请参阅以下说明)。
此扩展与Contao 4.4及更高版本兼容。
切换内容
要切换内容,您可以通过编辑元素设置或简单地在列表视图中使用图标来实现。
不同移动图像
要为移动设备使用不同的图像,请检查任何带有图像的元素的“不同移动图像”。
插入标签
ifmobile […] endifmobile, ifndesktop […] endifndesktop
如果它出现在桌面页面上,则从起始到结束标签之间的内容将被跳过。
ifdesktop […] endifdesktop, ifnmobile […] endifnmobile
如果它出现在移动页面上,则从起始到结束标签之间的内容将被跳过。
Body类
主体扩展了desktop、tablet或phone类。