melisplatform / melis-demo-cms
官方Melis平台演示网站
Requires
- php: ^8.1|^8.3
- melisplatform/melis-cms: ^5.2
- melisplatform/melis-cms-news: ^5.2
- melisplatform/melis-cms-page-script-editor: ^5.2
- melisplatform/melis-cms-prospects: ^5.2
- melisplatform/melis-cms-slider: ^5.2
Suggests
- melisplatform/melis-cms-news: Provides a venue for creating and maintaining news posts inside Melis Platform
- melisplatform/melis-cms-page-script-editor: MelisCmsPageScriptEditor provides a functionality to add custom scripts to the page and/or to the full site if desired.
- melisplatform/melis-cms-prospects: MelisCmsProspects provides a full Prospect system for Melis Platform, including templating plugins.
- melisplatform/melis-cms-slider: MelisCmsSlider provides a full Slider system for Melis Platform, including templating plugins.
- melisplatform/melis-engine: MelisEngine provides a set of services and classes to access the CMS pages and data.
- melisplatform/melis-front: MelisFront is the engine that displays website hosted on Melis Platform.
- dev-master
- v5.2.0
- v5.1.0
- v5.0.0
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.2.12
- v3.2.11
- v3.2.10
- v3.2.9
- v3.2.8
- v3.2.7
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.1
- v1.0.0
- dev-update/jquery3.7.1
- dev-develop
- dev-update/php83
- dev-fix/marketplace-download
- dev-update/php-8-upgrade
- dev-feature/news-draggable-paragraph
- dev-fix/page-creation-date
- dev-update/add-page-script-editor
- dev-update/add-breadcrumb
- dev-fix/duplicate-id-installer-form
- dev-feature/tinymce-custom-plugin
- dev-fix/dynamic-faq
- dev-fix/prospects-form
- dev-migrate/laminas
- dev-update/installation
- dev-feature/dragndrop_resize_margins
- dev-update/melis-demo-cms-v2
- dev-update/php7.4
- dev-update/jquery_v3.3.1
- dev-feature/tool-sites
- dev-feature/previews-news
- dev-melis-demo-cms-tinymce-update-5
- dev-update/gdpr
This package is auto-updated.
Last update: 2024-09-03 08:18:20 UTC
README
这是一个演示网站,提供了如何使用Melis模块服务的示例。
开始使用
以下说明将帮助您在您的机器上运行项目副本。
虚拟主机配置
MELIS_MODULE变量(标识哪个网站将作为此域的前端加载)。
我们应该使用MelisDemoCms
设置此变量
虚拟主机应如下所示
<VirtualHost *:80>
DocumentRoot "PATH_DOCROOT/public"
<Directory "PATH_DOCROOT/public">
Options +Indexes +FollowSymLinks +ExecCGI
DirectoryIndex index.php
Order allow,deny
Allow from all
AllowOverride All
Require all granted
</Directory>
ServerName www.mysite.local:80
SetEnv MELIS_PLATFORM "development"
SetEnv MELIS_MODULE "MelisDemoCms"
</VirtualHost>
要求
- composer/installers
- php 7
当使用composer时,这将自动完成。
安装
运行composer命令
composer require melisplatform/melis-demo-cms
网站中使用的模块
- Melis前端
- Melis引擎
- Melis CMS
- Melis CMS幻灯片
- Melis CMS潜在客户
- Melis CMS新闻
服务
-
MelisSiteConfigService
提供用于检索网站配置的服务。
文件:/melis-front/src/Service/MelisSiteConfigService.php
MelisFrontSiteConfigListener
用于通过合并文件和数据库中的配置来更新网站的常规配置服务。-
getSiteConfigByKey(key, section = 'sites', language = null)
此函数通过键检索特定的配置。调用服务。
$siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService');
要获取当前网站特定
key
和ID为1的页面的语言$siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService'); $config = $siteConfigSvc->getSiteConfigByKey('key', 1);
但如果我们想从当前网站的另一种语言获取键怎么办?我们可以通过在获取配置的地方定义语言来实现这一点。
$siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService'); $config = $siteConfigSvc->getSiteConfigByKey('key', 1,'sites', 'fr'); // The language of the page is now overridden by the specified language.
我们还可以通过使用
site Id
从另一个网站获取特定的key
。$siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService'); $config = $siteConfigSvc->getSiteConfigByKey('key', 1, 1); // Return all the values of the specified key from all languages from the site with id 1. // The expected output is an array of values from different languages $config = $siteConfigSvc->getSiteConfigByKey('key', 1, 1, 'fr'); // Return all the values of the specified key for the French language from the site with id 1.
除了网站外,还有一个不同的部分。目前,我们有两个部分,即网站和所有网站。
$siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService'); $config = $siteConfigSvc->getSiteConfigByKey('key', 1, 'allSites'); // Returns the key from the allSites section of the config // Language for the page is not applied but still used to get the site id and name to map for the config
-
-
MelisSiteTranslationService
提供翻译文本和列出所有网站翻译的服务
文件:/melis-front/src/Service/MelisSiteTranslationService.php
-
getText(translationKey, langId, siteId)
.调用服务。
$melisSiteTranslationSvc = $this->getServiceManager()->get('MelisSiteTranslationService');
要获取特定翻译,您需要指定翻译键以及语言ID和网站ID。
$test = $melisSiteTranslationService->getText('key', 1, 1); // Retrieves the translation for the language id 1 and site id 1.
-
-
有关SEO、URL服务和模板插件,请参阅Melis前端的完整文档
-
有关页面、树系统服务和引擎插件,请参阅Melis引擎的完整文档
-
有关CMS插件(标签、基本页面元素)和服务,请参阅Melis CMS的完整文档
-
有关CMS幻灯片插件和服务,请参阅Melis CMS幻灯片的完整文档
-
有关CMS新闻插件(新闻列表、最新新闻和详细信息)和服务,请参阅Melis CMS新闻的完整文档
-
有关CMS潜在客户插件(联系表单)和服务,请参阅Melis CMS潜在客户的完整文档
视图助手
Melis前端视图助手
-
MelisSiteConfigHelper
此助手用于获取网站的特定配置。
文件:/melis-front/src/View/Helper/MelisDragDropZoneHelper.php
函数:SiteConfig(key, sectiom = 'sites', language = null)
调用助手。
$this->SiteConfig('key');
获取当前站点的配置中的
特定键
。$config = $this->SiteConfig('key');
但如果我们想要从当前站点的另一个
语言
获取键
怎么办?我们可以通过定义获取配置
的地方的语言
来实现。$config = $this->SiteConfig('key', 'sites', 'fr'); // The language of the page is now overridden by the specified language.
我们还可以通过使用
site Id
从另一个网站获取特定的key
。$config = $this->SiteConfig('key', 1); // Return all the values of the specified key from all languages from the site with id 1. // The expected output is an array of values from different languages $config = $this->SiteConfig('key', 1, 'fr'); // Return all the values of the specified key for the French language from the site with id 1.
除了
sites
之外,还有不同的部分
。目前,我们有sites
和allSites
两个部分。$config = $this->SiteConfig('key', 'allSites'); // Returns the key from the allSites section of the config
-
MelisSiteTranslation
此助手用于获取站点的特定翻译。
文件:/melis-front/src/View/Helper/MelisSiteTranslationHelper.php
函数:getText(translationkey, langId, siteId)
调用助手方法。
$this->SiteTranslation('translationKey', 'langId', 'siteId');
要获取特定翻译,您需要指定翻译键以及语言ID和网站ID。
$text = $this->SiteTranslation('key', 1, 1); // Retrieves the translation for the language id 1 and site id 1.
-
有关更多Melis Front视图助手 请在此处查看Melis Front的完整文档
作者
- Melis Technology - www.melistechnology.com
还可以查看参与此项目的贡献者列表。
许可证
本项目根据OSL-3.0许可证授权 - 请参阅LICENSE.md文件以获取详细信息。