The alternative to deprecated Sitemap Module is a Solr-based Sitemap as Indicated on the Deprecations Page

As Magnolia allows Solr-based searches, we recommend using a Solr-based sitemap instead.

In addition to Step-by-Step integration Solr in Magnolia, you can use the solr_module. It lets you use a template in order to generate a sitemap. the template uses a special templating function: solrfn, which it´s included in the module

In git repository there is a module with the necessary templates and class to generate a Sitemap based in SOLR. Module has the following contents:

  • Java class: with the templating function necessary to get all Solr Indexes
  • Decorations folder: to modify Travel Demo templates and dialogs to allow hide pages in Sitemap.
  • Templates folder: with Sitemap template to use directly in Pages App. 

Module Installation: 

This module is not located in Magnolia Nexus, but you can clone the git repository, generate the jar file and install it in your bundle.  Then you need to configure the crawler in content-indexer module after configuring Solr as described in the Step by Step guide

Usage of the module:

You need to register the templating function as shown bellow:

Create the Sitemap Page using sitemap template from the module: 

Hide Pages in the sitemap: 

We create a checkbox in Page dialog to allow endusers decide to show or hide a Page in Sitemap. This check, called "Hide In SiteMap", includes a metatag in the template to avoid indexing by crawler. This tag is <meta name="robots" content="noindex">.


You can start the crawler with a cron expression (every hour) or by publication, when you publish a page. 

Is possible to delete all indexed elements in Solr, to do this you need a Terminal window: 

curl http://localhost:8983/solr/magnolia/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
curl http://localhost:8983/solr/magnolia/update --data '<commit/>' -H 'Content-type:text/xml; charset=utf-8'

  • No labels