I’ve created a page called ‘case-studies’ and getting the following error:
“Fatal error: Call to a member function isErrorPage() on boolean in /var/sites/domain.co.uk/public_html/kirby/kirby/kirby.php on line 333”
Something to do with how i use dashes, but not sure what is the correct method.
My content folder is called ‘case-studies’ and inside is ‘case-studies.txt’
Have you renamed the error page folder? Dashes in file names shouldn’t be a problem, but if in doubt, just try to rename the folder, file and template names.
Sorry texnixe, I’m not with you. I’ve renamed the files and folders to now have dashes and it works, so its definitely the dashes that are causing the issue. I’m just not sure how to allow them.
I don’t think there’s an option for allowing dashes. I’m using dashes in filenames myself and have never ran into any issues, so that makes it bit difficult to reproduce.
Thanks so much for the reply and Im sorry for the lateness in mine. I tried installed the start kit and working from scratch, but everything works without a dash, but when I add the dash it stops working!
If I enable debugging, I’m told the issue is with this line from a snippe (the snippet basically loops in existing children, and is a duplicate of the showcase snippet:
Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive.
Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: ‘[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*’ PHP: Basics - Manual
So, no dashes, sorry
You can use dashes in folder names, of course. In fact, Kirby creates folders with dashes, anyway, if you use multi-word titles.
Thanks - so now I understand that in theory the dashes in a url come from the folder. However I’ve added these and it’s still broken. I’m being told that
I’ve included a gif of my folder structure to ensure my naming in regards to dashes is correct. Basically I just want the dash in the url for standards purposes. Thanks so much!
As @bnomei already corrected, your variable may not have a dash in it, but your folder name does have a dash in it, so you have to use the dash in the page() helper.