Σελίδες εξόδου

Τελευταία ενημέρωση από Elxis Team

Generate and customize exit pages like error 404

Exit pages are pages that are generated by the system and displayed to the end user instead of the expected document, after a forced termination of the normal system flow. This crud stop can be triggered by a system error, a page not found signal and more.

Exit page types

There are 6 major types of exit pages.

  • Error 403 (forbidden). The user is not allowed to access the document.
  • Error 404 (page not found). The page requested was not found.
  • Error (generic error). Generic error page containing a custom message.
  • Fatal error (system error). A fatal error page containing a custom message. The difference between the fatal error and the error page is that the fatal error can be generated even before the elxis core is fully loaded. In this case the system backend support is limited.
  • Offline (site offline). The site is offline.
  • Request dropped (security stop). Elxis dropped the request for security reasons. As for the Fatal error page the system support is limited in this case.
  • Administration login (alogin). This page should only be generated by Elxis core.

Usage

An exit page can be triggered by using the static function make of the exitPage class.

exitPage::make('required page type', 'optional reference code', 'optional detailed message')

Example

exitPage::make('404');
exitPage::make('404', 'CRES-0005');
exitPage::make('404', 'CRES-0005', 'I didnt found the page you requested, sorry!');

Reference codes

The reference code displayed in the exit pages points you to the exact location in Elxis CMS from which the exit page was triggered. This code is unique and is consisted by 3 parts although only the first part is always available (rest parts are up to the extension's developer).

The first part is an acronym of the exit page type. For example ERR for an Error page, or E404 for an Error 404 page.

The recommended usage of the second and third parts (as used by Elxis core extensions) are:
Second part: The extension that generated the page. Use a C prefix for a component, M for a module, etc, following by the first 3 letters of the extension's name. Example: CUSE means component user. Third part: A 4-length incremental number unique in the extension. Example: 0012


Mobile version

Exit pages have also a mobile version. Elxis will auto-detect if the visitor uses a handhelp device and use the mobile version of the exit page automatically instead of the standard one.


Custom exit pages

In your template folder you can optionally create your own exit pages. If Elxis detects an exit page in the current template it will use that own instead of the system's one. Your exit page can have any HTML and CSS. We advice you to keep the system's exit pages messages and functionality (forms for example).

So, if you have a frontend template named super to create a custom Error 404 page create this file: templates/super/404.php If you wish to also create a mobile version of the error 404 page create also: templates/super/404.mobile.php The list bellow displays all the possible (optional) exit pages a template may have.

  • 403.php Forbidden
  • 403.mobile.php
  • 404.php Page not found
  • 404.mobile.php
  • alogin.php Administration login form
  • alogin.mobile.php
  • error.php Generic error
  • error.mobile.php
  • fatal.php Fatal error
  • fatal.mobile.php
  • offline.php Site offline page
  • offline.mobile.php
  • security.php Security alert (Elxis Defender)
  • security.mobile.php

Error log

Some of the exit pages inserts a new entry in the Elxis error log if logging is enabled. These are: Error 404, Error and Fatal Error.


Έχει διαβαστεί 5924 φορές
Observer
Επόμενο άρθρο
Observer

Μπορείτε να αντιγράψετε, διανείμετε και παρουσιάσετε τα άρθρα αυτού του ιστότοπου για μη εμπορικούς σκοπούς.
Creative Commons 3.0