# SOLVED: Dynamic rating value is not rendered in Builder

**URL:** <https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246>\
**Category:** Bugs\
**Tags:** v1-11\
**Created:** [October 22, 2024, 11:51am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246 "2024-10-22T11:51:35Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![HOSEIN](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/hosein/32/25907_2.png) [@HOSEIN](https://forum.bricksbuilder.io/u/HOSEIN)\
**Post date:** [October 22, 2024, 11:51am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/1 "2024-10-22T11:51:35Z")

</div>

**Browser** : Chrome 130.0.6723.59  
**OS** : Windows

Hi,

If we add a custom field to posts or CPT using Jet Engine or even WordPress custom field and use it to dynamically control the rating value, it works well in the front end, but in the rendering builder can’t. **It works well for products ({woo\_product\_rating:value}) and there are no problems.**

**Custom field**

![Custom field](https://forum.bricksbuilder.io/uploads/default/original/3X/1/c/1cfef93e98a0a22fdc00d1b47f41ddfc2ddd2f5e.png)

**in builder**

 ![in builder](https://forum.bricksbuilder.io/uploads/default/original/3X/9/6/96688a1c61a5d8931d90ececb703b70127229d51.png)

**in frontend**

 ![in frontend](https://forum.bricksbuilder.io/uploads/default/original/3X/5/6/56bca6fea26a4ee069f1589fe0b9fac516d9ca89.png)

Thanks

---

<div class="post-metadata">

**Author:** ![Patric](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@Patric](https://forum.bricksbuilder.io/u/Patric)\
**Post date:** [October 22, 2024, 4:59pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/2 "2024-10-22T16:59:00Z")

</div>

Works fine with me inside the builder as well as in the front end.

Did you chose the icon color for full and empty?

---

<div class="post-metadata">

**Author:** ![HOSEIN](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/hosein/32/25907_2.png) [@HOSEIN](https://forum.bricksbuilder.io/u/HOSEIN)\
**Post date:** [October 22, 2024, 5:15pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/3 "2024-10-22T17:15:40Z")

</div>

Yes, but it doesn’t work

---

<div class="post-metadata">

**Author:** ![Patric](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@Patric](https://forum.bricksbuilder.io/u/Patric)\
**Post date:** [October 22, 2024, 5:22pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/4 "2024-10-22T17:22:56Z")

</div>

For me it even works with my own dynamic tag.

> [@Dynamic stars rating from plugin for Bricks rating element](https://forum.bricksbuilder.io/t/dynamic-stars-rating-from-plugin-for-bricks-rating-element/26820):
>
> Hi in case seomebody wants to use the new Bricks rating element together with the rating plugin kk Star Ratings so that you can read the ratings from the plugin but are free to show different icons, color, sizes, etc., here is the code for that. Put this code into functions.php or a code snippet plugin: function get\_stars\_rating() { $best = get\_option('kksr\_stars'); $score = get\_post\_meta(get\_the\_ID(), '\_kksr\_ratings', true) ? ((int) get\_post\_meta(get\_the\_ID(), '\_kksr\_rat…

---

<div class="post-metadata">

**Author:** ![HOSEIN](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/hosein/32/25907_2.png) [@HOSEIN](https://forum.bricksbuilder.io/u/HOSEIN)\
**Post date:** [October 22, 2024, 5:28pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/5 "2024-10-22T17:28:29Z")

</div>

Strange, I’ll look into it further. I have this problem even in try.bricks builder.

---

<div class="post-metadata">

**Author:** ![Patric](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@Patric](https://forum.bricksbuilder.io/u/Patric)\
**Post date:** [October 22, 2024, 5:33pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/6 "2024-10-22T17:33:13Z")

</div>

Here the screen shot to show that it works for me in the builder with the dynamic tag

 ![IMG_0010](https://forum.bricksbuilder.io/uploads/default/original/3X/5/2/52cf184703b7f530db0a4a548bc8fb2924f41f37.jpeg)

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [October 22, 2024, 6:36pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/7 "2024-10-22T18:36:30Z")

</div>

Hi @HOSEIN,

just like @Patric said, it should be working. I’ve also tested locally, and it works. Was with ACF field, but this should not make a difference.  
You said that you were able to replicate it on a try.bricksbuilder. Do you have a page where I can see this?

Thanks.  
Matej

---

<div class="post-metadata">

**Author:** ![HOSEIN](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/hosein/32/25907_2.png) [@HOSEIN](https://forum.bricksbuilder.io/u/HOSEIN)\
**Post date:** [October 22, 2024, 6:46pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/8 "2024-10-22T18:46:09Z")

</div>

Hi Matej,

Yes, sure. But it works well in the front end.

[https://try.bricksbuilder.io/t7b3ff1b/ideas/](https://try.bricksbuilder.io/t7b3ff1b/ideas/)

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [October 23, 2024, 8:57am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/9 "2024-10-23T08:57:10Z")

</div>

Hi,  
thank you. I see and I was able to reproduce it and I’ve added it to the internal task list.

It seems though, that it’s not working only for the first item, and works for all next ones.

 ![slika](https://forum.bricksbuilder.io/uploads/default/original/3X/a/9/a9e583332322c1417dc871629079d4a00a5d7419.png)

And if the dynamic tag if from the options page, for example, it also works.

As always, we will update this topic as soon as the issue is fixed.

Thanks,  
Matej.

---

<div class="post-metadata">

**Author:** ![HOSEIN](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/hosein/32/25907_2.png) [@HOSEIN](https://forum.bricksbuilder.io/u/HOSEIN)\
**Post date:** [October 23, 2024, 9:20am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/10 "2024-10-23T09:20:24Z")

</div>

Hi Matej,

Thank you for reviewing this topic. Yes, I also confirm that this problem only occurs for the first item.

---

<div class="post-metadata">

**Author:** ![Matej](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/matej/32/20184_2.png) [@Matej](https://forum.bricksbuilder.io/u/Matej)\
**Post date:** [October 23, 2024, 9:23am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/11 "2024-10-23T09:23:55Z")

</div>

Perfect, thanks for confirmation.

Matej

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [November 11, 2024, 4:14pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/12 "2024-11-11T16:14:17Z")

</div>

Hi Hosein,  
We’ve fixed this issue in Bricks 1.11.1, now available as a one-click update in your WordPress Dashboard.

Changelog: [Bricks 1.11.1 Changelog – Bricks](https://bricksbuilder.io/release/bricks-1-11-1/)

Please let us know if you are still experiencing issues.

Best regards,  
timmse

---

<div class="post-metadata">

**Author:** ![Patric](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@Patric](https://forum.bricksbuilder.io/u/Patric)\
**Post date:** [November 15, 2024, 4:51pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/13 "2024-11-15T16:51:20Z")

</div>

Good evening

now with 1.11.1 my dynamic ratings are not showing at all anymore…

![Rating](https://forum.bricksbuilder.io/uploads/default/original/3X/b/6/b6bd4cd911559f35a86624b436ea4e4051721bdc.jpeg)

 ![Rating1](https://forum.bricksbuilder.io/uploads/default/original/3X/6/7/67e37df2d9f8f0869a899262ff95cb75a4fa60a7.jpeg)

If I replace the dynamic data with a manual value, the rating appears:

 ![Rating2](https://forum.bricksbuilder.io/uploads/default/original/3X/3/6/366c53bd7182f560d3f01426f30b644a5633f391.jpeg)

It was working perfectly before. So was there a change in the code regarding the rating element and a dynamic value?

Best regards

Patric

---

<div class="post-metadata">

**Author:** ![HOSEIN](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/hosein/32/25907_2.png) [@HOSEIN](https://forum.bricksbuilder.io/u/HOSEIN)\
**Post date:** [November 15, 2024, 5:03pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/14 "2024-11-15T17:03:53Z")

</div>

Hi @Patric,

For me there is no problem and it works well. I suggest you disable the plugins. Is the problem still there?

---

<div class="post-metadata">

**Author:** ![Patric](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@Patric](https://forum.bricksbuilder.io/u/Patric)\
**Post date:** [November 15, 2024, 5:11pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/15 "2024-11-15T17:11:49Z")

</div>

The problem is with the own dynamic tag. My dynamic tag is selfmade and it seems something does not work anymore with the rating element and a selfmade tag:

> [@Dynamic stars rating from plugin for Bricks rating element](https://forum.bricksbuilder.io/t/dynamic-stars-rating-from-plugin-for-bricks-rating-element/26820/2):
>
> Hi if you want to use a dynamic data tag {kk\_star-rating} for the rating, you can use this code: add\_filter( 'bricks/dynamic\_tags\_list', 'add\_starrating\_tag\_to\_builder' ); function add\_starrating\_tag\_to\_builder( $tags ) { // Ensure your tag is unique (best to prefix it) $tags[] = ['name' =\> '{kk\_star-rating}', 'label' =\> 'kk Star Rating', 'group' =\> 'My Dynamic Data Group',]; return $tags; } add\_filter( 'bricks/dynamic\_data/render\_tag', 'get\_starrating\_tag\_value', 20, 3…

Don’t know why yet. But if I change the selfmade dynamic tag to a function ({echo:…}), then the rating element works again.

Cheers

Patric

---

<div class="post-metadata">

**Author:** ![jolia](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/j/e68b1a/32.png) [@jolia](https://forum.bricksbuilder.io/u/jolia)\
**Post date:** [November 15, 2024, 5:57pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/16 "2024-11-15T17:57:06Z")

</div>

hello @Patric

May I ask, how do you display the rating value as 3.7? Because it is displayed as 3.70 by default.

---

<div class="post-metadata">

**Author:** ![Patric](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@Patric](https://forum.bricksbuilder.io/u/Patric)\
**Post date:** [November 15, 2024, 6:02pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/17 "2024-11-15T18:02:43Z")

</div>

Hi @jolia

My function (link is in the post above) rounds the value to 1 digit after the comma.

---

<div class="post-metadata">

**Author:** ![Patric](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@Patric](https://forum.bricksbuilder.io/u/Patric)\
**Post date:** [November 15, 2024, 6:44pm UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/18 "2024-11-15T18:44:07Z")

</div>

Hi

I narrowed down the problem.

If I create two dynamic data codes in the same function, then the dynamic code does not work anymore in the rating element.

If I just create one dynamic data code, then the dynamic code works in the rating element.

Is there a mistake in my code?

```auto
function render_kkstar_rating( $content, $post, $context = 'text' ) {
  // $content might consists of HTML and other dynamic tags
  // Only look for dynamic tag {my_dd_tag}
  if ( strpos( $content, '{kk_star_rating}' ) === false && strpos( $content, '{chochete_url}' ) === false ) {
    return $content;
  }

    switch (true) {
        case strpos( $content, '{kk_star_rating}' ): 
        $my_value = run_rating_dd_tag_logic();
        $content = str_replace( '{kk_star_rating}', $my_value, $content );
        break;
        case strpos( $content, '{chochete_url}' ): 
         $my_value = run_chocheteurl_dd_tag_logic();
        $content = str_replace( '{chochete_url}', $my_value, $content );
        break;
    }
  return $content;
}

```

because this code with only one dynamic data works:

```auto
function render_kkstar_rating( $content, $post, $context = 'text' ) {

  // $content might consists of HTML and other dynamic tags
  // Only look for dynamic tag {my_dd_tag}
  if ( strpos( $content, '{kk_star-rating}' ) === false ) {
    return $content;
  }
 
  // Do your custom logic here, you should define run_my_dd_tag_logic() function
  $my_value = run_rating_dd_tag_logic();
 
  // Replace the tag with the value you want to display
  $content = str_replace( '{kk_star-rating}', $my_value, $content );

  return $content;
}

```

The dynamic data code works in the title element, it only does not work in the rating element.

Strange.

---

<div class="post-metadata">

**Author:** ![Patric](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@Patric](https://forum.bricksbuilder.io/u/Patric)\
**Post date:** [November 16, 2024, 7:05am UTC](https://forum.bricksbuilder.io/t/solved-dynamic-rating-value-is-not-rendered-in-builder/27246/19 "2024-11-16T07:05:29Z")

</div>

OK, if I replace the case with if statements, it works.

```auto
  if (strpos( $content, '{kk_star_rating}' ) !== false ) {
        $my_value = run_rating_dd_tag_logic();
        $content = str_replace( '{kk_star_rating}', $my_value, $content );
        }
        if (strpos( $content, '{chochete_url}' ) !== false ) { 
        $my_value = run_chocheteurl_dd_tag_logic();
        $content = str_replace( '{chochete_url}', $my_value, $content );
        }

```

Must be something wrong in my case statement? Just curious why it worked before the latest version of Bricks and still works to print out the value. Just the rating element does not work anymore.

Cheers

Patric
