Thanks for sharing this! You're correct--because the {{banners}} object outputs an array of objects, if you want to stack banners on the front end, you'll see the delimiter unless you loop through the array with {{each}} or use the join helper:
{{{join banners.bottom ''}}}
I'm thinking this might best be addressed with documentation. What are your thoughts? Here's the current doc for {{banners}}, for reference:
I definitely think those docs could be improved. More or less including an example detailing that it does return an array and listing both the join or each options. I know Cornerstone uses limit now to just show one of the banners so I don't know how many other people are actually going to run in to this problem.
That's good feedback! We also recently merged a change in Cornerstone to use {{each}} in the footer (related to enhanced ecommerce support): github.com/bigcommerce/cornerstone...
That might be a good example to point to, along with the {{join}} array method. I'll get with our docs team to pass this along :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Jack!
Thanks for sharing this! You're correct--because the
{{banners}}
object outputs an array of objects, if you want to stack banners on the front end, you'll see the delimiter unless you loop through the array with{{each}}
or use the join helper:{{{join banners.bottom ''}}}
I'm thinking this might best be addressed with documentation. What are your thoughts? Here's the current doc for
{{banners}}
, for reference:developer.bigcommerce.com/stencil-...
I definitely think those docs could be improved. More or less including an example detailing that it does return an array and listing both the
join
oreach
options. I know Cornerstone useslimit
now to just show one of the banners so I don't know how many other people are actually going to run in to this problem.That's good feedback! We also recently merged a change in Cornerstone to use
{{each}}
in the footer (related to enhanced ecommerce support): github.com/bigcommerce/cornerstone...That might be a good example to point to, along with the
{{join}}
array method. I'll get with our docs team to pass this along :)