tomusborne / generateblocks

GenerateBlocks is a small collection of lightweight WordPress blocks that can accomplish nearly anything.
https://generateblocks.com
198 stars 23 forks source link

Query block inside element #1529

Open Shibumi-Agency opened 17 hours ago

Shibumi-Agency commented 17 hours ago

Description

Hi, This is my first bug report on GitHub, so I'm sorry if I'll do some mistakes. Anyway, I was trying to use the new query block (awesome) in an element to loop some "complete te look" products inside the product page but I'm not able to pull the meta if the "Select Post" is set to "Current post". Nor I can add to a container a link to the item url.

Steps to reproduce

  1. In order to do what I needed I firstly created a relation ACF (SCF) field and in the product page I selected the products. So far so good.
  2. I the went and created a block element in the element section and created a query block. I selected "Post Meta" as "Query Type" and "Current Post" as "Select Post". The only "Meta Key" available was "footnotes". I kinda solved by firstly selecting a specific post ad "Select Post". This allowed me to select the correct "Meta Key". I then reverted to "Current post" and still worked. This is the first issue.
  3. I added all the blocks for the loop (image, title, custom field, price) and it worked correctly.
  4. I then placed all the blocks in a container in order to add a dynamic link to it to take me to the product, without having to add links to every sigle block. Apparently there is no way to add a dynamic or static link to the container block unless you change the tag (makes sense). I then set the link to "Post permalink" but it takes me to the very same product page and not to the destination one.

References:

https://newland.shibumidev.it/shop/donna/maglieria-donna/maglia-test-2/


Screenshot 2024-11-25 at 12 27 14

Shibumi-Agency commented 17 hours ago

Edit: Solved the link issue. I had to use the loop item as an "a" and insert the link there. Anyway it should be handy to just use a container as a link container. Screenshot 2024-11-25 at 12 31 15

iansvo commented 7 hours ago

@Shibumi-Agency It appears you're editing an Element here and if so, that would be why you can't see the keys currently. When you're in an Element and using the query block for the "Current page" (like say, a query loop for a post type archive) the editor can't tell which postId belongs to the query item, so it can't list the keys.

We're working on a better way to preview things like this in elements, so once we do the UX around this should improve.