Forum
Template not found, when switching from perch_content to perch_content_custom
I have set up a Perch installation (latest release), put together a template and entered some content to a multi item region.
Outputting that content with perch_content works fine. Item after item are displayed one after the other as expected.
As soon as I switch to perch_content_custom to add some options like so
perch_content_custom('main_content', array());
I get the error message "The template main.html could not be found."
Adding options like
perch_content_custom('main_content', array(
'count' => 1
));
doesn't help.
What is happening here?
Does adding
help?
Nope, tried that too. But thanks anyway.
Sure :) I had to ask.
The error message sounds like it's looking for main.html but not finding it in
perch/templates/content
. Double check to make sure it's in there.If it's not there,
perch_content
would still work I think, because Perch saves the whole html for that region to the database. If you go to the edit page does it saymain.html
can't be found?What does debug show?
If you enable debug you'll be able to see what template it is trying to use.
Tried that too. Unfortunately it doesn't output anything at all.
In the backend it shows, though, so it should work.
When looking at debug in the backend, inside the region I am working in, it states
Have you added the line to your page to output debug?
https://docs.grabaperch.com/docs/installing-perch/configuration/debug/
Yes, I did—as stated in the docs page you provided.
Well if you are really getting "nothing" then you have a bigger problem. I'd suggest checking your PHP error log to find out why your page is terminating.
Will do and report here. Thanks, Rachel.
Huh, just solved the issue. (I was on vacation in the meantime.)
The Perch runtime was called with
After removing the $_SERVER bit and the first / like so
everything is working and back to normal.