[5.x] Hack in namespace so statamic gets the correct blueprint#148
[5.x] Hack in namespace so statamic gets the correct blueprint#148
Conversation
|
This wasn't an issue earlier, maybe something changed in Runway? Maybe better to fix it there? |
I tried with the oldest version of runway and statamic that this package allows and it still did not work. So I don't know if it really was not an issue earlier. As far as I can tell, this issue stems from Statamic essentially hardcoding the collection blueprint path right here. Given that this has been in the Statamic source code for at least 5 years and there doesn't seem to be any way to hook into any part of this (that I could find) I would be very surprised if it had worked in the past. |
|
I'd say merge this and create a follow-up story to research other solutions. |
When getting the entry directly like here, Statamic doesn't find the right blueprint because it only looks in the
collections/[handle]folder. This is hardcoded within Statamic so there's no easy way around that. This means that all category pages and product pages in the frontend (not the backend) currently break due to there being no blueprint attached to them, giving you raw data instead of augmented data.However, we can trick statamic into looking elsewhere by setting a custom namespace like this. It's a pretty gross hack, I don't like it. But it's the only thing I found that works.
We have to make sure it doesn't run when in the backend because otherwise it will show the extra blueprints from these hacky namespaces.