melisplatform / melis-demo-cms
Official Melis Platform Demo Site
Installs: 2 133
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 7
Forks: 0
Open Issues: 0
Language:CSS
Type:melisplatform-module
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.3.2
- v5.3.1
- v5.3.0
- 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-11-08 04:51:52 UTC
README
A demo site that provides examples on how to use the services of the Melis modules.
Getting Started
These instructions will get you a copy of the project up and running on your machine.
Vhost Configuration
MELIS_MODULE variable (identifies which site will be loaded as the front office for this domain).
We should set this variable with MelisDemoCms
Vhost should look like this:
<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>
Requirements
- composer/installers
- php 7
This will automatically be done when using composer.
Installing
Run the composer command:
composer require melisplatform/melis-demo-cms
Modules Used In The Site
- Melis Front
- Melis Engine
- Melis Cms
- Melis Cms Slider
- Melis Cms Prospects
- Melis Cms News
Services
-
MelisSiteConfigService
Provides services to retrieve the config for your sites.
File:/melis-front/src/Service/MelisSiteConfigService.php
MelisFrontSiteConfigListener
used to update the site's config on the regular config service by merging the config from the file and the one on the database.-
getSiteConfigByKey(key, section = 'sites', language = null)
This function retrieves a specific config by key.To call the service.
$siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService');
To get a specific
key
of the current site and the language of the page with id 1$siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService'); $config = $siteConfigSvc->getSiteConfigByKey('key', 1);
But what if we wanted to get the key from another language of the current site? We can achieve this by defining the language on where to get the config.
$siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService'); $config = $siteConfigSvc->getSiteConfigByKey('key', 1,'sites', 'fr'); // The language of the page is now overridden by the specified language.
We can also get a particular
key
from another site by using thesite Id
.$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.
There is also a different section apart from sites. Currently, we have two sections which are sites and allSites.
$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
Provides services to translate text and list all site translations
File:/melis-front/src/Service/MelisSiteTranslationService.php
-
getText(translationKey, langId, siteId)
.To call the service.
$melisSiteTranslationSvc = $this->getServiceManager()->get('MelisSiteTranslationService');
To get a particular translation, You need to specify the translation key along with the lang id and site id.
$test = $melisSiteTranslationService->getText('key', 1, 1); // Retrieves the translation for the language id 1 and site id 1.
-
-
For SEO, URL Services, and Templating Plugins See Full documentation for Melis Front here
-
For Page, and Tree System Services and Engine Plugins See Full documentation for Melis Engine here
-
For Cms plugins (tags, basic page elements) and Services See Full documentation for Melis Cms here
-
For Cms Slider Plugins and Services See Full documentation for Melis Cms Slider here
-
For Cms News Plugins (news list, latest news, and details) and Services See Full documentation for Melis Cms News here
-
For Cms Prospects Plugin (contact form) and Services See Full documentation for Melis Cms Prospects here
View Helpers
Melis Front View Helpers:
-
MelisSiteConfigHelper
This helper is used to get a specific config for a site.
File:/melis-front/src/View/Helper/MelisDragDropZoneHelper.php
Function:SiteConfig(key, sectiom = 'sites', language = null)
To call the helper.
$this->SiteConfig('key');
To get a
specific key
from the config for thecurrent site
.$config = $this->SiteConfig('key');
But what if we wanted to get the
key
from anotherlanguage
of thecurrent site
? We can achieve this by defining thelanguage
on where to get theconfig
.$config = $this->SiteConfig('key', 'sites', 'fr'); // The language of the page is now overridden by the specified language.
We can also get a particular
key
from another site by using thesite Id
.$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.
There is also a different
section
apart fromsites
. Currently, we have two sections which aresites
andallSites
.$config = $this->SiteConfig('key', 'allSites'); // Returns the key from the allSites section of the config
-
MelisSiteTranslation
This helper is used to get a specific translation for a site.
File:/melis-front/src/View/Helper/MelisSiteTranslationHelper.php
Function:getText(translationkey, langId, siteId)
To call the helper method.
$this->SiteTranslation('translationKey', 'langId', 'siteId');
To get a particular translation, You need to specify the translation key along with the lang id and site id.
$text = $this->SiteTranslation('key', 1, 1); // Retrieves the translation for the language id 1 and site id 1.
-
For More Melis Front View Helpers See Full documentation for Melis Front here
Authors
- Melis Technology - www.melistechnology.com
See also the list of contributors who participated in this project.
License
This project is licensed under the OSL-3.0 License - see the LICENSE.md file for details