NO BUG: Results of dynamic data query not rendering on archive page in builder or front end

Browser: Chrome 112.0.5615.50 (Official Build) (64-bit)
OS: Windows 11 Dev preview build 25314
URL: running on a .local site with Local by WP Engine
Video: Short screen recording that illustrates this issue Bird Eats Bug

Issue is present in both Bricks v1.7.1 and 1.7.2

I’m following along with this video trying to create a posts archive page Create a Full Website with Bricks Builder | Step by Step Tutorial - Review - YouTube - this is a link to the relevant section of the video

I set up a posts query on the category ‘News’ and want the dynamic data result of {post_terms_category} displayed in the heading of the page. As shown in the attached birdeatsbug video, {post_terms_category} is never replaced with ‘News’ in the builder and is blank on the front end. In the video I was following, {post_terms_category} gets replaced with ‘News’ in the builder and on the front end, it ends up with ‘Category: News’ for the heading. It’s totally possible I’m doing this all wrong but from what I can tell, I should end up with the same result as in the video. Hopefully, the attached birdeatsbug screencast will adequately describe what I’m trying to do

Hi,
is it possible that this video can help out?

Display categories on Wordpress + Bricks

Thanks, but that video wasn’t really what I was looking for. I appreciate your response though.

1 Like

Hi @senwebtek ,

Thanks for the video.
To output the title correctly in the archive template, please use the Post Title element or {archive_title} dynamic tag.

{post_terms_category} is meant for single post page, or if you are inside a post query loop.

Hope this helps.

Regards,
Jenn

Thanks @itchycode for the response. I’m trying to display the Category that the archive page is filtered on which is ‘News’. I’m not sure if the page is a query loop or not but in the ‘Query’ section of the Post element, I specified News(Category) for the ‘Include’ terms. I’m not trying to display the post title. Did you look at the video I linked to that I was following along with to set this up? From what I can understand, I should end up with an archive page with the search term displayed in the heading as shown in the video I linked to(not the screencast I provided). Anyway, thanks for your time.

Hi @senwebtek ,

I understand what you wish to achieve.
I did check the tutorial video as well (it was 2 years ago)

Do you want to give it a try by using {archive_title} instead of {post_terms_category}? Let me know if it doesn’t work. :slight_smile:

I used {archive_title} for the dynamic data in the heading and as expected, it displayed ‘Archives’ which is not what I want. When I use {post_terms_category} it displays nothing when I would expect it to display the category of the posts that are being queried. The fact that nothing is being returned at all is what made me think there might be a bug. Thanks.

Are you working with a Bricks (archive) template or a regular page? Since the {archive_title} dynamic tag does not work for you I guess you’re working with a regular page. In this case you have to explicitly set the title to whatever you want it to be – just like you explicitly set the Posts element’s query args to only fetch items from the News category.

I’m working with a Bricks archive template, not a regular page. Don’t know why {post__terms_category} is not returning anything.

Because this tag outputs the categories applied to a post. And since you are in an archive template (and not within a single template or a post loop) there is no post to get the categories from.

Since you’re working with an archive template: Could you show the template conditions?

Here you go: Bird Eats Bug let me know if this didn’t come thru. Thanks.

Hi @senwebtek

The {archive_title} might not populate correctly in the builder.
Could you please check if your actual frontend is working well?

Hi @itchycode. {archive_title} populates fine in the frontend. I’m still wondering why {post_terms_category} does not populate at all in the frontend. However, I’m trying to display the category of the posts listed on the archive page, not the archive title.

Hey @senwebtek, I was referring to the template conditions, not the query settings.

Sorry about that. I have no template conditions set.

OK, this is the last time I will post here about this issue. Would a moderator or admin be willing to look at this Create a Full Website with Bricks Builder | Step by Step Tutorial - Review - YouTube and try it out on a test site that I’ve created? I can PM you the login details. Thanks.

Hi Steve,
I haven’t really followed this thread, however, everything Jenn and Andre say is correct.

The video is +2 years old and it is very likely that something has changed with the Dynamic Data tag since version 1.0.

{archive_title} is definitely the correct tag you should use.

Best regards,
timmse

Thanks to everyone for their input. Hopefully I will understand this better as I gain more experience.