-
Notifications
You must be signed in to change notification settings - Fork 683
Inline search + element creation for relational fields #17497
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
Inline search + element creation for relational fields #17497
Conversation
|
Hi @brandonkelly, just checking: I can get the search field to appear if I have a single source selected, or if I have "Restrict assets to a single location" enabled, but in that latter case I can't seem to get the search field to appear if I also have "allow subfolders" checked. Is that the expected behaviour? That's fine if it is; just wondering, that's all … |
|
@AndrewMac It’s showing up when “Restrict assets to a single location is enabled on my end. Is your field’s “Show the search input” setting enabled? |
|
@AndrewMac Sorry nevermind, that is in fact a bug in in 5.8.0, fixed for 5.8.1 via #17548. |
|
Thanks so much! I know you probably get this all the time, but the way you and your team respond to issues and get fixes in place so quickly is one of the reasons I so much want to stick with Craft CMS. Of course, the amazing dedication to continually improving things is also another ;-) |
|
Hi @brandonkelly, this is generally working now, but I have a few fields where it still fails. Restrict assets to a single location: TRUE It works if path/to/subfolder is empty, or is a simple string Again, I'm not sure if this is something that can be fixed or not, but it would be great if it could be! |
|
@AndrewMac The only way I can reproduce that is if either: A) the subpath can’t be determined yet (e.g. it’s set to In both cases, it’s expected that the search input won’t show because we either don’t know where to search yet, or there’s no folder, so obviously no assets to be searched yet. |
|
Thanks @brandonkelly, I had another look and found that the problem is fixed when I use the double-brace {{ currentSite.group }}, which works, instead of the single-brace { currentSite.group }, which doesn't. Interestingly enough, I also found that the single-brace version does work if "Restrict assets to a single location" is unchecked with only one source selected. But I can get what we need with the double-brace anyway, so no issue. My fault, and sorry for taking up your time with this! |
|
Ah yeah – the single brace syntax is short for
|
Description
Relational fields with a single element source now have a “Show the search input” setting (enabled by default). When enabled, their inputs will get a search input for quickly selecting elements without having to go through the element selection modal.
Entries fields with a single section source and without a selection criteria condition also support inline entry creation.
Related issues