melisplatform/melis-cms-page-script-editor
Composer 安装命令:
composer require melisplatform/melis-cms-page-script-editor
包简介
Melis Platform Page Script Editor
README 文档
README
This module allows users to add custom scripts and styles at the site and page levels.
Getting started
These instructions will get you a copy of the project up and running on your machine.
Prerequisites
The following modules need to be installed to run the Melis CMS Page Script Editor module:
- Melis core
- Melis engine
- Melis front
- Melis CMS
Installing
Run the composer command:
composer require melisplatform/melis-cms-page-script-editor
The Melis CMS Page Script Editor module needs to be manually activated on the chosen site for the defined scripts to be rendered in front. This will be done by going to MelisCms > Site Tools > Sites menu, select a site, then activate the module in the 'Module Loading' tab.
Database
Database model is accessible via the MySQL Workbench file:
/melis-cms-page-script-editor/install/sql/Model
Database will be installed through composer and its hooks.
In case of problems, SQL files are located here:
/melis-cms-page-script-editor/install/sql
Tools and elements provided
- Scripts tab in Melis CMS' Page System
- Scripts tab in Melis CMS' Tool Site
- Page Script Editor Service
- Listeners
Scripts Tab in Melis CMS' Page System
- A 'Scripts' tab is added inside Melis CMS' page system where the user can add scripts to be inserted after the opening head tag, before the closing head tag, or before the closing body tag of the page when rendered
- The user may opt to exclude the site's scripts in which during the rendering process, only the page's defined scripts are included
Scripts Tab in Melis CMS' Tool Site
- A 'Scripts' tab is added inside Melis CMS' Tool Site in which the scripts that are set here will be applied to all pages belonging to the site, except for the pages that excluded the site's scripts
- List of pages that exclude the site's scripts are displayed and the user has the option to remove the page from the exception list
- The user also has the ability to add a page to the exception list
Page Script Editor Service
File:
- /melis-cms-page-script-editor/src/Service/MelisCmsPageScriptEditorService.php
-
MelisCmsPageScriptEditorService
- This service's functions include the retrieval and adding of page or site's scripts.
//Get the service $pageScriptEditorService = $this->getServiceManager()->get("MelisCmsPageScriptEditorService"); //Retrieve final scripts of the page $resultList = $pageScriptEditorService->getMixedScriptsPerPage($pageId);- Common methods this service is used for are as follows:
- Retrieving page scripts: getScriptsPerPage(...)
- Retrieving site scripts : getScriptsPerSite(...)
- Retrieving site exceptions: getScriptExceptions(...)
- Saving page or site scripts : addScript(...)
- Saving exception : addScriptException(...)
- For a more detailed information on the methods, please visit the file.
Listeners
There are three listeners inside the module:
- MelisCmsPageScriptEditorSavePageListener
- MelisCmsPageScriptEditorSaveSiteScriptListener
- MelisCmsPageScriptEditorScriptTagListener
Files:
- /melis-cms-page-script-editor/src/Listener/MelisCmsPageScriptEditorSavePageListener.php
- /melis-cms-page-script-editor/src/Listener/MelisCmsPageScriptEditorSaveSiteScriptListener.php
- /melis-cms-page-script-editor/src/Listener/MelisCmsPageScriptEditorScriptTagListener.php
-
MelisCmsPageScriptEditorSavePageListener
- This is triggered when the page in Melis Cms' Page Edition is saved or published and will automatically save the script data and the exception configuration defined for the given page
-
MelisCmsPageScriptEditorSaveSiteScriptListener
- This is triggered when the site is saved and will automatically save the script data and the exception configuration defined for the given site
-
MelisCmsPageScriptEditorScriptTagListener
- This is triggered when the page is rendered
- The scripts for the page will be inserted to its defined destination(after the opening head tag, before the closing head tag or before the closing body tag)
- If the page exluded the site's scripts, only the page's scripts will be inserted, else, the scripts will be the combination of the site and page's scripts where the site's scripts will always come first during the rendering process
- For a more detailed information on the listeners, please visit the files.
Authors
- Melis Technology - www.melistechnology.com
See also the list of contributors who participated in this project.
License
This project is licensed under the Melis Technology premium versions end user license agreement (EULA) - see the LICENSE.md file for details
melisplatform/melis-cms-page-script-editor 适用场景与选型建议
melisplatform/melis-cms-page-script-editor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 753 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zf2」 「module」 「cms」 「melis」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 melisplatform/melis-cms-page-script-editor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 melisplatform/melis-cms-page-script-editor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 melisplatform/melis-cms-page-script-editor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LosLog provides some log utility
GraphQL authentication for your headless Craft CMS applications.
EdpModuleLayouts is very simple Laminas module for making module-specific layouts insanely easy.
Set Links with a specific language parameter
Supercharged text field validation.
Zend Framework module to leverage the symfony dependency injection container
统计信息
- 总下载量: 753
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 17
- 依赖项目数: 2
- 推荐数: 2
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2022-03-25