How do I find the error page of the site?
LandingPageUtil provides methods to find the 404 page, the 401 page and others
Published: 2022-07-22 | Updated: 2024-09-26
LandingPageUtil has methods to find globally configured pages of the site. For example the "Error page" (404) and the "Login page" (401).
Step 1 - Get an instance of LandingPageUtil
For WebApp/RESTApp - use import:
js
import landingPageUtil from '@sitevision/api/server/LandingPageUtil';
For Script module - use require:
js
const landingPageUtil = require('LandingPageUtil');
Step 2 - Make use of LandingPageUtil
js
// Get hold of the error page
const the404Page = landingPageUtil.getErrorPage();
// Get hold of the login page
const the401Page = landingPageUtil.getLoginPage();