-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature: Add media
dynamic tag
#1569
Conversation
@@ -722,6 +731,25 @@ export function DynamicTagSelect( { onInsert, tagName, selectedText, currentPost | |||
</> | |||
) } | |||
|
|||
{ 'media' === dynamicSource && ( | |||
<> | |||
<SelectPost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason we wouldn't want to do an actual Media Library modal here? Seems odd to ask someone to choose an image from a list where they can't see the image, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be ideal, but I wanted to get this into the release candidate, and I figured adding a new pattern like a Media Library modal would have some increased overhead.
It would definitely be nice for the user to be able to choose the image. Worth a quick play to see what kind of overhead we're looking at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks pretty good, I haven't gotten to test it yet but I'll confirm after I do.
Just one overall comment re: media selection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the current change from select post, this may cause incorrect behavior in other places (ex: Query block options).
We just need to make sure the other implementations are updated to use the correct postStatus value. The only 2 places that come to mind are the free/pro Query Inspector Controls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomusborne Looks like you need to add handling for the media source and include the 'source" supports in your tag registration.
When I first pulled this, the source selection didn't show up at all (because source support isn't declared) but even then you're going to need some logic to make the labels make sense and such.
Requires https://github.com/EDGE22-Studios/components/pull/13
This allows us to use a
{{media}}
dynamic tag to pull in items from the Media Library.This can be used to dynamic fetch images, or their captions/alt tags etc...