-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Using asset field with {slug} as upload location #22
Comments
Cheers mate! At work at the moment, but I'll look into this when I get home. Thanks for the report. |
Damn it's been nearly a week already? Sorry I haven't gotten around to this yet, kept busy with another project which will be done with on Monday. I haven't had a chance to check this out yet but after this week I'll be on it. |
Finally had a look through this, and I've discovered the problem. When parsing the target directory, it applies any This is a tough problem, though I might be able to trick asset fields into thinking they're owned by the Neo fields' containing element when parsing the directory. In the meantime, you will have to create a duplicate field that uses |
I've found that in order to properly fix this, I'd have to override a few hundred lines of core code and monkey patch the front-end Javascript, which is far from ideal. Aside from creating a duplicate field just for Neo blocks, I've come up with another way of accomplishing this. Since you can use anything Twig provides in the asset fields directory fields, you can use this to your advantage. To begin, Bad news is, there's no built-in way to detect this. But since this is for a plugin, I've just implemented a Twig extension into Neo (to be available in the next release) that allows you to test if some value is a Neo block model. Now we can do this: Yes, it's more verbose than |
Hi Benjamin.
First of all, LOVE the plugin. It's how the Matrix should work by default.
But I'm having a error when uploading an asset file (S3) with a preset upload location with {slug} as variable. The error is only showing when using the field inside Neo. As standalone field it's uploading fine.
This is the error: Could not resolve the subpath “{slug}”.
The text was updated successfully, but these errors were encountered: