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

WIP contextual-query-loop branch #10

Open
carstingaxion opened this issue May 23, 2024 · 13 comments
Open

WIP contextual-query-loop branch #10

carstingaxion opened this issue May 23, 2024 · 13 comments

Comments

@carstingaxion
Copy link
Owner

carstingaxion commented May 23, 2024

contextual-query-loop branch

image

@carstingaxion
Copy link
Owner Author

carstingaxion commented May 23, 2024

Outdated screencast 🎦
Bildschirmaufzeichnung.vom.23.05.2024.04.25.17.mp4

@carstingaxion
Copy link
Owner Author

carstingaxion commented May 23, 2024

Outdated screenshot 🖼️

image

@carstingaxion
Copy link
Owner Author

carstingaxion commented May 23, 2024

Needed a new block to demo another block

Name of the current post type using the Block Bindings API

https://gist.github.com/carstingaxion/f98c213aad40d6413fe50eac1cc92228

@carstingaxion
Copy link
Owner Author

carstingaxion commented May 23, 2024

Outdated screenshot 🖼️

image

@carstingaxion
Copy link
Owner Author

Hello @ryanwelcher,

feel free to have a look, what was possible in a short time, because of your solid & exciting fundament. Thank you very much for equipping me (and others) with the right tools & code to solve long-standing issues!

It is amazing 🎈 🎉 🥳 !

@carstingaxion carstingaxion changed the title WIP WIP contextual-query-loop branch May 23, 2024
@carstingaxion
Copy link
Owner Author

carstingaxion commented May 23, 2024

Outdated screencast 🎦

Bildschirmaufzeichnung.vom.23.05.2024.21.17.40.mp4

@carstingaxion
Copy link
Owner Author

Bildschirmaufzeichnung.vom.24.05.2024.22.18.17.mp4

@carstingaxion
Copy link
Owner Author

Bildschirmaufzeichnung.vom.26.05.2024.12.37.17.mp4

Contextual queries with

  • the same author as the context post
  • explicitly not the same author ...
  • posts by the currently logged-in user

@carstingaxion
Copy link
Owner Author

carstingaxion commented May 26, 2024

Screenshot of a demo to show & test different uses of a new contextual-query-block.

The demonstrated queries are:

  1. IN same author
  2. IN same author & other post type
  3. NOT IN same author
  4. Some IN same tags
  5. All IN same tags
  6. NOT IN same category
  7. IN same category & NOT IN same tags
  8. EXACT same date
  9. BEFORE same year
  10. AFTER same month
  11. EXACT same day last month
  12. EXACT same day last year

image

@carstingaxion
Copy link
Owner Author

image

Finished my ideas around queries by contextual date. Inspired by

@mrgoff93
Copy link

This looks great, thanks for working on it!

It's not yet quite what I am hoping for. In my case, I would like to specify a date - either contextually (for example, using the date the post was published), or by choosing it directly (via a calendar selection).

So if the date was 2023-05-20, then the query would return any posts published on YYYY-05-20 across all the years (which in my case could back over 20 years).

Just to offer a little more context, my site is all about natural history, and I have been posting photojournals of what I observe on a given day going back to the early 2000s. With the functionality I'm hoping for, it would be easier to create a daily or weekly almanac of sorts for my area.

Thank you!

@carstingaxion
Copy link
Owner Author

carstingaxion commented May 29, 2024

This looks great, thanks for working on it!

Thank you @mrgoff93

It's not yet quite what I am hoping for. In my case, I would like to specify a date - either contextually (for example, using the date the post was published), or by choosing it directly (via a calendar selection).

Ok, this is already in place & should work.

So if the date was 2023-05-20, then the query would return any posts published on YYYY-05-20 across all the years (which in my case could back over 20 years).

You are right, this is not possible right now. But what I did so far is close to that and it might be not of a big deal to extend the existing logic. Currently you can query for what happened on day x 13 years ago, but not on day x over the last 13 years.

Just to offer a little more context, my site is all about natural history, and I have been posting photojournals of what I observe on a given day going back to the early 2000s. With the functionality I'm hoping for, it would be easier to create a daily or weekly almanac of sorts for my area.

This is really cool, you are describing your use-case like this. I had some similar thoughts, imaginating someone doing wild-life photography during all seasons of the year and for many years. That feels super-close to what you describe.

@carstingaxion
Copy link
Owner Author

image

it might be not of a big deal to extend the existing logic

@mrgoff93 No, it wasn't. Exactly 4 lines of code added, to make this work.

Now, it seems to be the perfect sibling to @coffee2code|s - Years Ago Today – Dashboard widget.

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

No branches or pull requests

2 participants