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

Extending the Query Loop default fields #333

Open
bph opened this issue Nov 13, 2024 · 5 comments
Open

Extending the Query Loop default fields #333

bph opened this issue Nov 13, 2024 · 5 comments

Comments

@bph
Copy link
Collaborator

bph commented Nov 13, 2024

Discussed in #324

Originally posted by paaljoachim October 22, 2024
Currently the Query Loop will show the default fields of Title, Featured image, date and excerpt.
It would be helpful to extend the Query Loop to show additional fields.

A use case.
An artist has an album post. It uses the standard fields.
Title = album name
Featured image = album cover
Excerpt = a description of the album
Date = date when the album came out

He would like to add artists whom contributed to the album.
He especially would like to add album tracks.

This means two additional fields:
Contributed to album
and
tracks

As I see it one would need to define specific blocks that will be seen in the Album preview page where the Query loop would also show these specific blocks.

It would actually be very helpful to have two methods for this. Likely the regular Json file and code snippets. Code snippets would be an easy way to add a snippet directly to the web site without even having access to the files outside of WordPress. Having a Code snippet plugin one could just add the snippet turn it on and see the result. Go forth and back between the result and the snippet to easily adjust the code.

@bph
Copy link
Collaborator Author

bph commented Nov 13, 2024

@paaljoachim This topic was approved. Would you be available to write this tutorial for the developer blog?

@paaljoachim
Copy link

Hey @bph Birgit.

Yes. That I would like to do. I will need help though.
I can probably ask questions in the core-dev-blog Slack channel. As this will be my first article.

@bph
Copy link
Collaborator Author

bph commented Nov 13, 2024

That's awesome, @paaljoachim Thank you!
I sent you an invitation for this repo so you can move the issue along in the Developer Blog Content Board

And here are three links for you. They should get you started.

Notes on creating and formatting a Google Doc #242 This issue also has a link to the Google Doc Template.

Yes, you can always ask questions in the core-dev-blog channel, or comment on this issue.

@bph bph moved this from Needs a writer to To-do in Developer Blog Content Board Nov 14, 2024
@bph
Copy link
Collaborator Author

bph commented Dec 4, 2024

See also Slack discussion in #core-dev-blog

@paaljoachim
Copy link

Thinking out loud.
The first step seems to be creating a Custom Post Type. For that I would like to follow the most up to date tutorial on creating a CPT. I have for my various sites used the CPTUI plugin https://wordpress.org/plugins/custom-post-type-ui/

But I do wonder if WP core has a method I can follow instead that uses newer methods that can be easy to follow.

Second step is testing out the https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/extending-the-query-loop-block/ (I see that is has just been updated)
Then looking at:
https://developer.wordpress.org/news/2022/12/building-a-book-review-grid-with-a-query-loop-block-variation/ and

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants