Type of site


Definition

Since 3.1 version, the sites have type.

The type of site determines the content types, the services and the tools available, suited to the type of site.

Sample of type of site :

  • default for website : a web site with classic sitemap
  • intranet / extranet : a web site with secure access on all sitemap or on subtrees
  • blog: a blog with posts

How to create a new type of site ?

Declaration

A type of site an extension point.

It is composed by :

  • a unique name without spaces or special characters
  • a (i18n) label
  • a (i18n) full description
  • a small icon in 16x16 pixels
  • a medium icon in 32x32 pixels
  • a large icon in 48x48 pixels

It is declared in plugin.xml file like the following example:

<feature name="sitetype.blog">
    <extensions>
      <extension id="org.ametys.web.sitetype.Blog"
                 point="org.ametys.web.repository.site.SiteTypesExtensionPoint">
           <name>blog</name>
           <label i18n="true">MYPLUGIN_SITETYPE_BLOG_LABEL</label>
           <description i18n="false">MYPLUGIN_SITETYPE_BLOG_DESCRIPTION</description>
           <icons>
                 <small>img/sitetype/blog_16.png</small>
                 <medium>img/sitetype/blog_32.png</medium>
                 <large>img/sitetype/blog_48.png</large>
           </icons>
      </extension>
    </extensions>
</feature>

Configuration

For each type of site, you need 4 configuration files in WEB-INF/params directory :

  • cms-ribbon-[siteTypeName].xml : the personalized ribbon for this type of site
  • cms-uitools-[siteTypeName].xml : the default open tools for this type of site
  • content-types-[siteTypeName].xml : the list of availables content types for this type of site
  • services-[siteTypeName].xml : the list of availables services for this type of site

List of availables content types

This list is defined in content-types-[siteTypeName].xml file

There are two modes :

  • include : to accept only the content types listed in file. This is the default mode
<?xml version="1.0" encoding="UTF-8"?>

<content-types mode="include">
      <content-type id="org.ametys.web.default.Content.article"/>
      <content-type id="org.ametys.plugins.news.Content.news"/>
      <content-type id="org.ametys.plugins.multimedia.Content.photosGallery"/>
      <content-type id="org.ametys.plugins.multimedia.Content.multimediaGallery"/>
</content-types>
  • exclude: to accept all content types except those listed in file
<?xml version="1.0" encoding="UTF-8"?>

<content-types mode="exclude">
      <content-type id="org.ametys.plugins.newsletter.Content.newsletter"/>
</content-types>

List of availables services

This list is defined in services-[siteTypeName].xml file

There are two modes :

  • include : to accept only the services listed in file. This is the default mode
<?xml version="1.0" encoding="UTF-8"?>

<services mode="include">
	<service id="org.ametys.web.service.SitemapService"/>
	<service id="org.ametys.web.service.FrontSearchService"/>
	<service id="org.ametys.web.service.IframeService"/>
	<service id="org.ametys.service.Revamping"/>
	<service id="org.ametys.web.service.FilteredContentsService"/>
	<service id="org.ametys.web.service.InsertContentService"/>
	<service id="org.ametys.web.service.AttachmentsService"/>
</services>

  • exclude: to accept all services except those listed in file
<?xml version="1.0" encoding="UTF-8"?>

<services mode="exclude">
	<service id="org.ametys.web.service.IframeService"/>
	<service id="org.ametys.service.Revamping"/>
</services>

Back to top