Mantra how-to guide

Define the landing page for a Mantra web application

The landing page is just a view defined by any component

29-Mar-2022
A  A  A 

Many of the default features of Mantra are defined in the configuration file mantraconfig.json.

Among them, there exists a property with the name "LandingView". With that property, you indicate to Mantra which is the landing page of your web application, this is, what Mantra should render when the users points to http://yoursite/ of http://yoursite/index.html.

As usual in many Mantra properties, LandingView is defined in the format: "[component name].[view name]".

This is a global property that can be overwritten in a specific application in your project.

Take this example:

"Apps": {
   "usersite": {
      "Port": 8082,
      "FrontendLocation": "userssite",
      "LandingView": "landing.userslanding"
   },
   "adminsite": {
      "Port": 8083,
      "FrontendLocation": "frontendadmin",
      "LandingView": "admin.dashboard"
   }
}

As we can see in this piece of a mantraconfig.json sample file, in this project there are two differents web site applications, "usersite" and "adminsite", listening at 8082 and 8083 ports respectively.

You can see that each of them, defines differents landing pages: "landing.userslanding" (view "userslanding" that is defined in the component "landing") and "admin.dashboard" (view "dashboard" that is defined by the component "admin").

And that's all.