Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

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 to view the templates and use the Java class to get the Templating function to use in your sitemap ftl.

In git repository https://git.magnolia-cms.com/projects/SERVICES/repos/solr_sitemap/ there is a module with the necessary templates and class to generate a Sitemap based in SOLR. Module has the following contents:

  • Java class: SiteMapTemplatingFunction.java 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">.

Crawler:

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