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:
This is how I get it from the API (in this case: 7 bids available):
Then I use the Visibility Condition in several ways to show if the reserve price is met etcā¦
1 Like
dejan
November 8, 2023, 10:41am
4
You guys are becoming pros
@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 ā¦
1 Like