grav-plugin-form icon indicating copy to clipboard operation
grav-plugin-form copied to clipboard

Support @data: prefix for file field destinations

Open hughbris opened this issue 4 years ago • 4 comments

The file field destination property currently supports @self:, @page:, and @theme: prefixes. I guess these are focused on use within blueprints. In userland, I generally save files under user/data and it would be cool to have this as a prefix.

I know user/data isn't a lot of typing. This is another one of those things that doesn't quite work in multisite setups, so a failsafe prefix would cover making it work in that kind of deployment, as opposed to user/sites/mysite/data. It might prevent brittle hardcoding in other contexts too, not sure.

For further context, I find it handy to use multisite setups to demo sites for clients, especially those without a spare domain. All going well, I move them over to single site deployment. In my perfect world, I'd minimise the tweaking and gotchas in that step.

I am happy to attempt a PR if you are happy with this but don't see it as a priority.

hughbris avatar Dec 02 '20 22:12 hughbris

Destination supports also user-data://my-folder, you should use that instead. It will automatically work in multi-site environments if you setup it correctly.

mahagr avatar Dec 04 '20 07:12 mahagr

So does destination support any stream? I want to update the docs because having this knowledge here is inadequate.

hughbris avatar Jan 15 '22 03:01 hughbris

So does destination support any stream?

Just noticed #119 which answers my own question. It would be great and ultimately time-saving if new features like this could be added to docs as they are added. You're just creating tech support debt otherwise.

Edit to add to this: if I don't have time, I add it to my documentation todo list to make sure it doesn't get overlooked forever.

hughbris avatar Jan 15 '22 03:01 hughbris

Submitted PR to grav-learn now and don't need the originally requested feature, so happy for you to close this issue if you don't plan to implement it. Up to you.

hughbris avatar Jan 19 '22 23:01 hughbris