Questions tagged [error-templates]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
11
votes
3answers
5k views

What's the best way to set up a content-manageable 404 page?

I'd like to make my 404 page editable through Craft, but when I create a single for it, a URI is required. Is there a way to make a single with no URI, or is the best route to setup globals for ...
7
votes
3answers
2k views

Render generic message/error template from plugin

Basically, I'm trying to emulate show_error from EE/CI: http://ellislab.com/codeigniter/user-guide/general/errors.html I want to just use the generic Craft error template (/craft/app/templates/error....
5
votes
1answer
943 views

Generic catch-all error template

Is there a catch all error page template? I'd like to use http://http.cat for my statuses. (originally asked by Bryan Redeagle in Craft Slack)
5
votes
1answer
2k views

How to return errors from a model back to the template?

I'm working on validation with Craft. I have a custom plugin that allows public submission. However, I want to make sure I can pass errors back to the template. The key is trying to make my code as "...
4
votes
1answer
628 views

How do you create dynamic error pages?

I want to have one template handle all of my error pages (instead of creating 404.html, 500.html, &c.).
4
votes
1answer
742 views

User Registration Form error message customisation

Where can I edit the error messages for the user registration form e.g for {% if account is defined %} {{ _self.errorList(account.getErrors('email')) }} {% endif %} I want to change this ...
3
votes
1answer
2k views

Returning errors into templates

When working with a custom form that posts to a plugin function - what's the best way to return errors that would be displayed like the forgot password code example below {% if errors is defined %...
2
votes
2answers
255 views

Redirect 'expired' or deleted entries

I have a job board running on Craft. We're "auto expiring" the posts from listing pages based on the post date. However, I want to redirect the actual entry page to either a 'this job has expired' ...
2
votes
1answer
320 views

ElementAPI -> Find entry template name

I'm using many "entry type" templates as described here: http://buildwithcraft.com/help/entry-type-templates. I'm using ElementAPI to render full entries as HTML embedded into JSON. I'm using this ...
2
votes
1answer
72 views

Error on functions in queue: "Session does not exist in a console request."

I get the following error on multiple order mails from Craft Commerce. The error points out to the lines where a macro is called: Email template parse error for email “New order”. Order: “e35f244”. ...
2
votes
1answer
683 views

Custom 503 template

I am preparing to upgrade a site from Craft 2 to 3, and would like to make a custom template to deal with the 503 Service Unavailable when the migrations need to be run. I have set devMode to false ...
2
votes
1answer
838 views

Suppress HttpException.404 for bad URLs

Requests for non-existent templates/pages (404s) result in an uncaught HttpException.404 being thrown, though the correct 404 template is displayed. Is there some way to suppress or handle this ...
1
vote
4answers
6k views

Template not found 404

Having a strange issue - devMode is set to false, if I go to /404, I get the custom 404 page, which is great. If I go to /something1234567890 (which is definitely not an entry's URL) I get the ...
1
vote
2answers
349 views

Blog template not displaying posts

The blog post should display the posts created but when I got to the slug /blog it says 404 not found as well as the press news should be displayed here /press-news but same thing happens. If i ...
1
vote
2answers
41 views

Wrong urls printed for small subset using getNext and getPrev

I have a related question regarding previous and next throwing a template error for some entries. This is similar, but different. A few entries in the same section depict the wrong previous and next ...
1
vote
1answer
765 views

Why would Craft produce a template loader error (TemplateLoaderException) when rendering its default error pages?

I'm getting a Template Loader Exception when I hit a 404 on my site: Craft\TemplateLoaderException Unable to find the template “error”. (/craft/app/etc/templating/twigextensions/TemplateLoader.php:...
1
vote
1answer
2k views

Problem loading css files in some templates

I´m having problems loading css files in some templates. Hi have this to load css files: {% includeCssFile "assets/html/css/reset.css" %} {% includeCssFile "assets/html/css/general.css" %} {% ...
1
vote
1answer
26 views

vhost.conf and general understanding

I am new to craft CMS and installed it in an Amazon EC2 instance via Composer. This worked. My vhost.conf looks like this <VirtualHost *:80> ServerName craft.example.com DocumentRoot /var/www/...
1
vote
1answer
161 views

Template not found: $PRIMARY_SITE_URL/$PRIMARY_SITE_URL/blog/this-is-my-blog

Very new to craft CMS, recently just installed XAMPP with php 7 and craft 3 and followed the getting started tutorial from Craft CMS. Then when I try to preview or open the page created from the ...
1
vote
1answer
151 views

Craft admin twig templates broken somehow

I am a front end designer building my site locally. This is the first time I've built in Craft and things have been coming along fine but now I'm getting the following error on every craft admin page ...
1
vote
1answer
234 views

Can access admin page (now), but not any site pages...yii not found http execption

Have not accessed my local .test sites in a bit. I tried today. I am getting a series of errors. At first I could not access any page to include the admin page. I ran Composer update from the ...
1
vote
1answer
6k views

How can I test my 500 error page works

I had a problem with my cloud server and all my sites were generating 500 errors. The response page the visitor saw varied between Craft 2, Craft 3 and ExpressionEngine 2 sites. The Craft 3 ones ...
1
vote
1answer
516 views

Why is Craft rendering a blank page instead of an error template?

I'm currently seeing this in the PHP error logs: Fatal error: Uncaught exception 'Craft\\HttpException' with message '' in /home/vagrant/htdocs/site/craft/app/controllers/TemplatesController.php:59\...
1
vote
1answer
144 views

Setting tab 'error' class for tab with error

When creating an editor interface within my plugin, I am using the following snippet to create a set of tabs inside a tab pane: {% include "_includes/tabs" with { tabA: { label: 'Tab A'|t, url: '#...
1
vote
1answer
150 views

How to split the user login error message between username and password?

Hoping this is possible. I want to split the username and password error message to return it separately depending whether it is username or password that is incorrect and not just a the generic (...
1
vote
1answer
1k views

404.html template causing twig_error_syntax

I created a generic 404.html template to replace the default Craft page. I'm getting the following error when forcing a 404 in browser. Any idea what the issue is? Twig_Error_Syntax The filter "...
1
vote
1answer
646 views

Property "Craft\WebApp.assetUpload" is not defined

I came across error Property "Craft\WebApp.assetUpload" is not defined, when registering users from front end. Is this a bug or missing config param? I have used the example on craft website: https://...
0
votes
2answers
2k views

Getting image url error code: Impossible to access an attribute ("url") on a null variable

My site just suddenly broke down on a certain page with the following error code, (see screenshot). It is occuring for every image on this page and really confusing me. Any quick suggestions?
0
votes
1answer
239 views

Error while trying to use dynamic routing to pass variables to the template and using them

So i'm trying to pass the variables from a dynamic route to a template and then to use those variables to filter trough entries. the catch is that the same template is used to display an "organic"(by ...
0
votes
1answer
646 views

Include results in "Object of class Craft\ElementCriteriaModel could not be converted to string"

I have a template with just this code: {% include 'amenities/_types/amenities' %} This results in a template error: Object of class Craft\ElementCriteriaModel could not be converted to string ...
0
votes
0answers
46 views

Email template error

In the logs, I have this error: 2021-02-01 18:00:04 [-][-][-][error][craft\commerce\services\Emails::sendEmail] Email template parse error for email “Order Submitted”. Order: “123456”. Template error:...
0
votes
0answers
64 views

WebP transform >> AssetTransformException: Failed to generate transform with id of X

I'm trying to transform some images on my site from JPG to WebP. However, I am having a problem to do so on my production site. I get this error: 2021-01-27 16:13:40 [-][-][-][error][craft\errors\...
0
votes
0answers
21 views

How can I best troubleshoot a 404 error loading a template from a previous iteration of my site?

I had a Craft Site, which I'll refer to here as the old site. I replaced it with a new site on the same server. To do this I overwrote the old site's database and files. I kept the old site's public ...
0
votes
0answers
108 views

How to use getTemplateName() from within a plugin?

I wondered if we could embellish from this answer? I'm developing a plugin where at some point it needs to detect if the user is currently on one of the error pages (400, 403, 404, 500, or 503). I'...