Reopened Terms provider count issue

Hello,

I’d like to revisit this ticket: Current Terms Provider, incorrect result

I’ve modified your login so you should see the full back-end now, the same credentials apply.

The issue I’ve reported still remains.

Thanks, Bill.

Hi Bill,

Thanks for reaching out.
I have checked the Looper and found the problem. The text contains the pipe sign (|) and is assigned to the Looper Consumer, and that is why it is showing at the end of the loop too. There should be a condition to check if that is not the last item in the loop. I added the same text without the pipe sign added the condition for that, and added the opposite condition for the text with the pipe sign. Now it is working as expected.

image

image

Thanks

Many thanks - that fixed something else, but it isn’t what I reported in the original ticket!

In the accordion called here: https://share.cleanshot.com/psVpGdSM

I have a debug Text element which reports on the total number of items returned by the Provider, which shows 1. But after that the consumer doesn’t consume anything as there isn’t any results.

This is the problem I actually meant to have you look at!

Many thanks, Bill.

Hi Bill,

I just checked and found that the result is coming inside the Accordion as expected. Can you please check and confirm that?

Thanks

That’s right, but not what I’m asking.

  • The number of terms in the taxonomy HPS Species for this post is zero.
  • The number of items returned by the value {{dc:looper:count}} is 1
  • The consumer is now showing “News” as one of those terms which doesn’t exist: https://share.cleanshot.com/l03bGXSq

My question (or your bug) is why the looper count is 1, when the actual terms are empty? Why does it show “News” when that term isn’t even in the HPS Species Taxonomy?

Good luck, Bill.

Hi Bill,

I have checked the Looper Provider and found that the HPS Plant Names is mentioned in the Taxonomy, not the HPS Species as mentioned here and in the screenshot in a previous thread. Also I didn’t find the HPS Species in the list. I would suggest you check this once.

Thanks

That’s the right one, the slug is species, the names is HPS Plants!

Hello Bill,

When there is a Looper Provider, there should be a Looper Consumer.

Make sure that the item has an assigned plant name. If nothing is assigned, no output will likely be displayed.

Thanks.

Hello @ruenel

Fair point, I’ve added a Debug Div at the top to illustrate the point:

Result: https://share.cleanshot.com/f7L04tLw

Here’s the simple structure: https://share.cleanshot.com/q6lQgnVj

The DC variable {{dc:looper:count}} returns 1
But the consumer doesn’t consume

Can you look again? Thanks, Bill.

That debug DIV is only displayed for Admins, so you can modify that part of the page without risk.

Hi Bill,

You need to enable the Looper Consumer to the DIV otherwise, the {{dc:looper:count}} will not show the value for the current Looper Provider. As you enable the Looper Consumer to the Term it does not show any value, whereas the Looper Count is showing the normal term count that is 1. Enabling the Looper Consumer to the DIV will solve the problem.

In the Builder it shows the default Term value, which is available for any post.

Thanks

I changed the consumer to be a Div, same result:

Hi Bill,

The {{dc:looper:count}} is not associated with the Looper Consumer, and that is why it shows the value. It will show the same result in Builder as it shows based on the default post and default Term. If you open any of the specific post browsers you will get the exact output. Please set Looper Consumer to the DIV where you add the Looper Provider, and you will get the result you expect.

URL: https://hardy-plant.org.uk/hps-bursary-reports-march-july-2024/

image

Hope it helps.
Thanks

OK, I see what you’ve suggested but that can’t be the right answer. The looper:count is always set right after the provider so you can then set conditions on elements to handle it. I’ve taken this approach many times.

I made three sections: https://share.cleanshot.com/Xs2m3VRg

Mine, yours and a the same pattern as mine, but with regular posts.

Why does the looper:count return 1 when in the builder? Your solution works but doesn’t match how I’ve built many similar structures within this site.

I think this is really confusing, and your solution isn’t a proper answer IMO.

Many thanks, Bill.

Hello Bill,

The {{dc:looper:count}} dynamic code should be used inside the Looper Consumer. It displays 1 even if there are no items since it counts the size of the array.

You will use the Provider Output is empty if you want to apply a condition to the looper.

Take the URL as an example in the secure note below.

Thanks.

Thank you. What’s weird is that I have been using the Looper Count before the Consumer successfully in many places.

Anyway, my final question: https://share.cleanshot.com/q7pnYh3g

Many thanks, Bill.

Hi Bill,

The Cornerstone shows the output with the default post, that is why it shows only on Builder. While showing any specific post in Browser, it will only show the value from that post only.

Hope I am able to clarify it.
Thanks

I’ve tried setting the preview URL to a specific post but the output still shows one item from the current terms in the builder - this makes no sense. Why does it show the ‘default post’ when the content on the screen is from 1 specific post?

Here’s a screenshot: https://share.cleanshot.com/T5t2q4wl

This is very confusing. I start by editing the layout with a specific post, and then choose another URL in the preview dropdown - why do I still see the wrong results in the builder?

Bill.

Hello Bill,

Could you please provide the URL of the specific post items you have tried in the builder for us to compare and explain why this is happening when you are in the builder?

Thank You.

We’re back where I started on the original ticket:

On this page: https://hardy-plant.org.uk/hps-bursary-reports-march-july-2024/

Here’s another:

And this

Many thanks, Bill.