I have set a taxonomy term loop and added an accordion to it as the loop item then set the accordion title to be dynamicly loaded from the term name , so filnally I got a term loop which each item is an accordion .
Now I need to add a quiry to the content of the tab to load posts in that category , so each tab content must have a list of items related to the category which is the tab title.
No console error, just a 500 Server Error when saving, and a critical error on the front-end.
Here’s what the server log says:
2023/02/17 03:34:45 [error] 1451516#1451516: *211283 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key "videoType" in /var/www/mydomain.com/htdocs/wp-content/plugins/cwicly/core/includes/dynamic/query/cc-query-templater.php on line 977PHP message: PHP Fatal error: Uncaught Error: Call to undefined method WP_Term_Query::have_posts() in /var/www/mydomain.com/htdocs/wp-content/plugins/cwicly/core/includes/dynamic/cc-helpers.php:526
Stack trace:
#0 /var/www/mydomain.com/htdocs/wp-content/plugins/cwicly/core/includes/dynamic/render.php(218): cc_query_front_maker()
#1 /var/www/mydomain.com/htdocs/wp-content/plugins/cwicly/core/includes/dynamic-blocks/query-template/query-template.php(52): cc_render()
#2 /var/www/mydomain.com/htdocs/wp-includes/class-wp-block.php(256): cc_query_template_render_callback()
#3 /var/www/mydomain.com/htdocs/wp-includes/class-wp-block.php(242): WP_Block->render()
#4 /var/www/mydomain.com/htdocs/wp-includes/class-wp-block.php(242): WP_Block->render()
#5 /var/www/mydomain.com/htdocs/wp-includes/class-wp-block.php(242): WP_Block->render()
#6 /var/www/mydomain.com/htdocs/wp-content/plugins/cwicly/core/includes/dynamic/cc-helpers.php(501): WP_Block->render()
#7 /var/www/mydomain.com/h" while reading response header from upstream, client: 99.123.456.19, server: mydomain.com, request: "POST /wp-json/wp/v2/pages/677/autosaves?_locale=user HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php81-fpm-mydomain.com.sock:", host: "mydomain.com", referrer: "https://mydomain.com/wp-admin/post.php?post=677&action=edit"
Oh wait, I definitely wasn’t using a Taxonomy Terms element. Just a nested query. Will need to play around with it tomorrow to see if that’s the secret unlock.
With Frontend Rendering, all blocks (and queries) are rendered (created) on the user end instead of server end. This allows us a lot more freedom when manipulating data (Filter block) since we have access to all the context, and helps the server performance wise when dealing with similar/repeater layouts.
What is happening here is that the Taxonomy Terms block is rendered on the server but your Query block is rendered on the user side, essentially they’re not communicating with eachother.
We will be extending Frontend Rendering to the Div block so that you can have one context box instead of limiting it to the Query and Filter Block.
Araminta seems to have confirmed it, but I will take a look and confirm on my side. But it does sound like a bug.
If so, we should have this fixed in the next update → Monday.
Normally, anything inside a frontend rendered block should work as if rendered on the server. Sorry for the inconvenience on this one!
Nested queries are on their way, but currently not supported within a Frontend Rendered block (requires a few fixes for the filtering logic and parent context).
Not quite If you want to inherit some context from the parent block (term ID, post ID), then the parent will have to have frontend rendering active if your child has frontend rendering.