Template Tags
Given the following settings, Custom System Messages will deliver all ExpressionEngine's action and form messages inline with your normal templates. In this case the messages.group/error.html
file will serve as the default template for all global error messages. The template code below is an example of a basic sign in form in the /account.group/sign-in.html
file. It is also defined in the Custom Actions section as the template to use for success and error messages when submitting the sign in form. All other non-login related errors in this example will be displayed in the /messages.group/error.html
template. Note that both Submission Error and General Error fields are required.
If you add a {redirect=""} tag in any of your templates defined in CSM, then the error messags will not be displayed in the template, even if the template you're redirecting to is defined in CSM to handle errors. This is because the messages are not saved during a full http request/redirect. All redirections need to be handled by CSM as defined in it's settings.
account/sign-in Template
Result
The result of this configuration is the error messages are shown above the login form, instead of on a separate template, and at the same URL. You can still use a separate template if you like. The combination of settings in Custom System Messages gives you the flexibility to use whichever template you prefer to display your sites error or success messages.
Last updated