Open jimblue opened 5 years ago
I'm not sure but it might related to: https://statamic.com/forum/3050-locales-tag-not-working-on-error-page
Apparently the error come from the {{ locale }}
tag.
Maybe it's because the 404 page doesn't seems to have a local variable?
In case it helps, here is the langswitcher.html partial where I use the {{ locale }}
tag:
{{ locales }}
{{ if locale:name != locale_name }}
<a class="button" href="{{ url }}">{{ locale:name }</a>
{{ /if }}
{{ /locales }}
Also, I've notice that the {{ 404 }}
tag is not working while using the custom template.
Thank you so much for your help! 😃
Cheers
I can't reproduce this. Can you give any more details? What does your system.yaml look like?
Also, why are you trying to use the {{ 404 }} tag on your 404 template? You're already on a 404.
I confirm the problem come from the {{ locales }}
tag. When I remove it from my custom error template, it fix the problem.
Didn't you try to add the above snippet to a custom error template?
BTW, here is my system.yaml:
locales:
en:
name: en
full: en_US
url: 'https://statamic.test/'
fr:
full: fr_FR
name: fr
url: 'https://statamic.test/fr'
timezone: UTC
date_format: 'F jS, Y'
default_extension: md
filesystems:
content:
driver: local
root: site/content
storage:
driver: local
root: site/storage
users:
driver: local
root: site/users
themes:
driver: local
root: site/themes
url: /site/themes
app_key: 6mXpUSPsbizeeM0ypnfetGVcn9e692zD
redactor:
-
name: Standard
settings:
buttons:
- formatting
- bold
- italic
- link
- unorderedlist
- orderedlist
- html
-
name: Basic
settings:
buttons:
- bold
- italic
csrf_exclude:
- '/!/Fetch/*'
- /!/Charge/webhook
yaml_parser: symfony
send_powered_by_header: true
ensure_unique_ids: true
Yes I tried your snippet. Try changing your french url to 'https://statamic.test/fr/'
fixed! thank you so much 👍
Sorry I've talk to fast and forgot to clear cache... Adding an ending slash didn't help...sadly
Anyone got solution for this , i tried all but still having issue
Ok I've maybe found out.
This bug happen if you don't have any global file named global.yaml
.
Can you that confirm guys?
Confirmed.
I've fixed it, although, what are you expecting this tag to output on a page with no content?
For translation feedback obviously 😄 ! Thank for the fix, I close this issue then.
But if you are on a 404 page, what are you translating?
The error message
Where are you defining the error message?
Ok I've maybe found out. This bug happen if you don't have any global file named
global.yaml
. Can you that confirm guys?
I have the same issue. Did you put a new global.yaml in the 'settings' folder? What did you write in it to solve the problem? In your 'theming.yaml', is your var 'error_template_folder: /' ? Thanks for your help
Describe the bug Statamic crash when I switch from default 404 template to a custom one. I've follow the documentation by creating a /errors/404.html template.
The error summary
and
A link to the full error message
To Reproduce Steps to reproduce the behavior:
Expected behavior By following https://docs.statamic.com/knowledge-base/error-pages I should be able to see my custom error template.
Environment details: