Skip to content
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

Merged
merged 5 commits into from
Dec 7, 2024

Conversation

tomusborne
Copy link
Owner

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...

@tomusborne tomusborne added the feature Features, refactoring, enhancements, improvements label Dec 5, 2024
@tomusborne tomusborne added this to the 2.0.0 milestone Dec 5, 2024
@tomusborne tomusborne requested a review from iansvo December 5, 2024 02:22
@@ -722,6 +731,25 @@ export function DynamicTagSelect( { onInsert, tagName, selectedText, currentPost
</>
) }

{ 'media' === dynamicSource && (
<>
<SelectPost
Copy link
Collaborator

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?

Copy link
Owner Author

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.

Copy link
Collaborator

@iansvo iansvo left a 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.

Copy link
Collaborator

@iansvo iansvo left a 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.

Copy link
Collaborator

@iansvo iansvo left a 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.

@tomusborne tomusborne merged commit 39ea6c2 into release/2.0.0 Dec 7, 2024
9 checks passed
@tomusborne tomusborne deleted the feature/add-media-dynamic-tag branch December 7, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features, refactoring, enhancements, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants