The Page List "404" Problem
Before Concrete version 5.6.2, there was a problem when overriding core blocks that had their own
view.css file -- the system would get confused and try to serve a non-existing
view.css file from your top-level
SITEROOT/blocks/ directory, which caused a 404 error on pages with that block. This most commonly occurred with the
Page List block (because it is such a useful block that it winds up getting customized on almost every site, and (unlike the similarly-useful
Autonav block) it does have a
view.css file in its core directory, which is what triggers this error).
Here is a demonstration of this problem on a site running Concrete5.6.1:
I've added a "Page List" block to this page, and the web inspector's "Network" tab shows us that the
SITEROOT/concrete/blocks/page_list/was properly loaded:
Next, I'm going to create a custom template adding a new
Now, if I reload the page (note that I have not chosen the new custom template yet), I see this:
Well, isn't that weird -- the system is trying to load a
view.cssfile from my top-level
SITEROOT/blocks/page_list/directory. What happens if I actually use the new custom template?
So the mere existence of a custom template seems to throw off C5 and cause this 404 error. If you keep experimenting with custom templates, you'll see that this doesn't occur when the custom template is nested inside a sub-folder (e.g.
SITEROOT/blocks/page_list/templates/my_template_name/view.php), nor does it occur if a plain old
view.php file exists in the
This problem is easy enough to fix by simply copying the
SITEROOT/concrete/blocks/page_list/view.css file up to the top-level
SITEROOT/blocks/page_list/ directory. But this assumes one is even aware of the problem in the first place (which I'm guessing a lot of people aren't). Furthermore, it is very inconsistent and adds one more piece of mental baggage to the already-complex (and not entirely intuitive) process of building a modern website.
The 5.6.2 Fix
As of Concrete version 5.6.2, this issue has been addressed. The new rule is very consistent and easy to explain:
If you create a custom template, the system will look for related assets (CSS and JS files) in the custom template directory.
This also means that if you don't have any CSS or JS files for your custom template, the system will not erroneously try to load those file (and hence not create a 404 error).
That's it! Easy to understand and easy to work with, just the way it should be.