Mixing static content and dynamic content

Pulling from my REST API, I want to mix some of my Dynamic content with some static content in the same element. How do I do that?

For example, within a Header (h2) element, I want to write:

<h2>Learn all about ${$value->get('company')->get('name')}</h2>

Is this possible to do?

Yes you can, you can structure it like this and it should work:

Learn all about return ${value->get('name')}
1 Like

@will_lutz Idk if this helps:
I’m creating an auction site, and this is how I need to “dig” into the API responses for multi arrays:

To show how many bids are made:

return ${value->get('bids')}.length

Return how many bids been made and grab the latest bid amount:
Skärmavbild 2023-11-08 kl. 08.01.23

This is how I get it from the API (in this case: 7 bids available):
Skärmavbild 2023-11-08 kl. 08.02.14

Then I use the Visibility Condition in several ways to show if the reserve price is met etc…

1 Like

You guys are becoming pros :smiley:

@will_lutz

from (yours example)

<h2>Learn all about ${$value->get('company')->get('name')}</h2>

to (what will work)

<h2>Learn all about ${value->get('company')->get('name')}</h2>

Check the difference.

2 Likes

I see. I had an extra “$” That’s why I was getting stuck. Thanks guys! I’m a React/node guy. This is the first time I’ve used jQuery/PHP syntax at all.

With a lot of help from you @dejan:pray:t3:

1 Like