getgrav / getgrav/grav-plugin-form

Support @data: prefix for file field destinations

Open
#460 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
64
Forks
80
Avg merge
10h 13m
Merged PRs (30d)
9

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the file field `destination` handling and the existing `@self:`, `@page:`, and `@theme:` prefix logic. Check how paths resolve in single-site and multisite deployments, then define tests that demonstrate the expected `@data:` behavior and confirm both deployment modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.