Adding a new site - BloomReach Experience - Open Source CMS

This article covers a Hippo CMS version 12. There's an updated version available that covers our most recent release.

02-01-2018

Adding a new site

This page assumes you already are familiar with 1) Adding a new language to an already existing site as adding a new site is very similar.

Steps in the CMS

Assume we already have a content folder  myproject. Now, depending on whether the new site needs to be translated or not, you need add a root 'folder' or 'non-translated folder' in the CMS Content Perspective. Do this by clicking  Add root folder . Assume we add  mysecondproject

Now, add some initial folder structure and documents. This may be similar to the already existing site, or completely different, depending on your use case.

If you need this new site to be translated, repeat the steps at  1) Adding a new language to an already existing site after you finished this page.

Steps in the HST-2 configuration

1 Add a new hst:configuration for the new site mysecondproject .

Assume we already had different translations for  myproject and have the following  hst:configuration:

/hst:hst:
  /hst:configurations:
    /hst:default:
    /common:
      /hst:pages:
      /hst:components:
      /hst:templates:
      /hst:catalog:
    /myproject:
      hst:inheritsfrom: [../common]
      /hst:sitemap:
      /hst:sitemenus:
      /hst:channel:
        hst:name: My project
    /monprojet:
      hst:inheritsfrom: [../common]
      /hst:sitemap:
      /hst:sitemenus:
      /hst:channel:
        hst:name: Mon projet

(note in the example above, the hst:channel is not below the hst:workspace, meaning it will be read-only, also see Workspace Configuration)

Depending on your domain specific use case, we can or cannot reuse the common part for the already existing site myproject. Assume, the new site  mysecondproject has the same  hst:componentshst:templates and  hst:catalog but it has different  hst:pages. We can thus reuse everything except the  hst:pages. If we first move hst:pages to a new hst:configuration   sharedpages, and make sure we do cascading inheritance, we can later on easily add  mysecondproject. Thus

Step 1 Split off hst:pages from  common

/hst:hst:
  /hst:configurations:
    /hst:default:
    /common:
      /hst:components:
      /hst:templates:
      /hst:catalog:
    /sharedpages:
      hst:inheritsfrom: [../common]
      /hst:pages:
    /myproject:
      hst:inheritsfrom: [../sharedpages]
      /hst:sitemap:
      /hst:sitemenus:
        /hst:channel:
          hst:name: My project
    /monprojet:
       hst:inheritsfrom: [../sharedpages]
       /hst:sitemap:
       /hst:sitemenus:
          /hst:channel:
            hst:name: Mon projet

hst:inheritsfrom for myproject and monprojet now have cascading inheritacen

The hst:inheritsfrom inherits from sharedpages which in turn inherits from common. If sharedpages does not inherit from common, you can still inherit from common as follows: hst:inheritsfrom = {../sharedpages , ../common} where the property has two values. 

Step 2 Add mysecondproject

/hst:hst:
  /hst:configurations:
    /hst:default:
    /common:
      /hst:components:
      /hst:templates:
      /hst:catalog:
    /sharedpages:
      /hst:pages:
    /myproject:
      hst:inheritsfrom: [../sharedpages , ../common]
      /hst:sitemap:
      /hst:sitemenus:
        /hst:channel:
          hst:name: My project
    /monprojet:
      hst:inheritsfrom: [../sharedpages , ../common]
      /hst:sitemap:
      /hst:sitemenus:
        /hst:channel:
          hst:name: Mon projet
    /mysecondproject:
      hst:inheritsfrom: [../common]
      /hst:sitemap:
      /hst:sitemenus:
      /hst:pages:
        /hst:channel:
          hst:name: My second project

Now, add  mysecondproject, also see  1) Adding a new language to an already existing site

2 Add a new hst:site for the new site

This is the same as described at  1) Adding a new language to an already existing site

Assume you already had:

/hst:hst:
  jcr:primaryType: hst:hst
  /hst:sites:
    jcr:primaryType: hst:sites
    /myproject:
      jcr:primaryType: hst:site
    /monprojet:
      jcr:primaryType: hst:site

After adding the mysecondproject, you'll have something like:

/hst:hst:
  jcr:primaryType: hst:hst
  /hst:sites:
    jcr:primaryType: hst:sites
    /myproject:
      jcr:primaryType: hst:site
    /monprojet:
      jcr:primaryType: hst:site
    /mysecondproject:
      jcr:primaryType: hst:site

Make sure that for  mysecondproject, you change the hippo:content property to the absolute JCR path /content/documents/mysecondproject you created at the beginning of this page. 

3 Create the host or "URL space" for the new site.

Assume you already had

/hst:hst:
  jcr:primaryType: hst:hst
  /hst:hosts:
    jcr:primaryType: hst:virtualhosts
    /prod:
      jcr:primaryType: hst:virtualhostgroup
      /com:
        jcr:primaryType: hst:virtualhost
        /myproject:
          jcr:primaryType: hst:virtualhost
          /www:
            jcr:primaryType: hst:virtualhost
            /hst:root:
              jcr:primaryType: hst:mount
      /fr:
        jcr:primaryType: hst:virtualhost
        /monprojet:
          jcr:primaryType: hst:virtualhost
          /www:
            jcr:primaryType: hst:virtualhost
            /hst:root:
              jcr:primaryType: hst:mount

now, adding the new site as a new host can be done as follows:

/hst:hst:
  jcr:primaryType: hst:hst
  /hst:hosts:
     jcr:primaryType: hst:virtualhosts
     /prod:
       jcr:primaryType: hst:virtualhostgroup
       /com:
         jcr:primaryType: hst:virtualhost
         /myproject:
           jcr:primaryType: hst:virtualhost
           /www:
             jcr:primaryType: hst:virtualhost
             /hst:root:
               jcr:primaryType: hst:mount
         /mysecondproject:
           jcr:primaryType: hst:virtualhost
           /www:
             jcr:primaryType: hst:virtualhost
             /hst:root:
               jcr:primaryType: hst:mount
       /fr:
         jcr:primaryType: hst:virtualhost
         /monprojet:
           jcr:primaryType: hst:virtualhost
           /www:
             jcr:primaryType: hst:virtualhost
             /hst:root:
               jcr:primaryType: hst:mount

Above, we have added the host  www.mysecondproject.com. Make sure the  hst:mountpoint for 

/hst:hst/hst:hosts/prod/com/mysecondproject/www/hst:root 

points to the site node  /hst:hst/hst:sites/mysecondproject created in the step 2.

If you do not want the new site to have a different hostname, but a different URL, you can instead configure it as follows (again make sure the  hst:mountpoint is correct)

/hst:hst:
  jcr:primaryType: hst:hst
  /hst:hosts:
     jcr:primaryType: hst:virtualhosts
     /prod:
       jcr:primaryType: hst:virtualhostgroup
       /com:
         jcr:primaryType: hst:virtualhost
         /myproject:
           jcr:primaryType: hst:virtualhost
           /www:
             jcr:primaryType: hst:virtualhost
             /hst:root:
               jcr:primaryType: hst:mount
               /second:
                 jcr:primaryType: hst:mount
       /fr:
         jcr:primaryType: hst:virtualhost
         /monprojet:
           jcr:primaryType: hst:virtualhost
           /www:
             jcr:primaryType: hst:virtualhost
             /hst:root:
               jcr:primaryType: hst:mount

Now, the new site is available at  www.myproject.com/second

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?