Hi there, my first post…
My code:
<meta name="keywords" id="colours" dmx-repeat:repeatcolour="productdetails.data.productquery.colours" dmx-bind:content="productdetails.data.colourquery.colourName">
<!--start dmx-repeat:repeatcolour=productdetails.data.productquery.colours--><meta name="keywords" dmx-bind:content="{{colourName}}" content="Black"><meta name="keywords" dmx-bind:content="{{colourName}}" content="Blue"><meta name="keywords" dmx-bind:content="{{colourName}}" content="Brown"><meta name="keywords" dmx-bind:content="{{colourName}}" content="Green"><meta name="keywords" dmx-bind:content="{{colourName}}" content="Grey"><meta name="keywords" dmx-bind:content="{{colourName}}" content="Orange"><meta name="keywords" dmx-bind:content="{{colourName}}" content="Pink"><meta name="keywords" dmx-bind:content="{{colourName}}" content="Purple"><meta name="keywords" dmx-bind:content="{{colourName}}" content="Red"><meta name="keywords" dmx-bind:content="{{colourName}}" content="White"><meta name="keywords" dmx-bind:content="{{colourName}}" content="Yellow"><!--end dmx-repeat:repeatcolour=productdetails.data.productquery.colours-->
How do I get it to output as:
name="keywords" dmx-bind:content="{{colourName}}" content="Black, Blue, Brown, Green etc..."
Thanks in advance for any help.
Justin
ben
March 10, 2026, 9:23pm
2
Assuming productdetails.data.productquery.colours is the array, then try using array.join() instead of a repeat. The code would look something like:
<meta name="keywords" content="{{ productdetails.data.productquery.colours.map(colourName).join(', ') }}">
Where
map(colorname) extracts just the colour names from the array
join(', ') merges them into a single comma‑separated string.
1 Like
Hi Ben, thanks for your reply.
I have changed the code but I get a blank output.
i.e.
<meta name="keywords" content="{{ productdetails.data.productquery.colours.map(colourName).join(', ') }}">
I am wondering if a js library is missing from my installation.
Justin
Teodor
March 11, 2026, 9:02am
4
Can you show the output of the following expression?
{{productdetails.data.productquery.colours}}
I have it on the page further down like this:
<!--start dmx-repeat:repeatcolour=productdetails.data.productquery.colours--><span class="badge bg-secondary style63" style="--bs-badge-border-radius: 2px;" id="colours">Blue</span><span class="badge bg-secondary style63" style="--bs-badge-border-radius: 2px;" id="colours">Green</span><span class="badge bg-secondary style63" style="--bs-badge-border-radius: 2px;" id="colours">Grey</span><!--end dmx-repeat:repeatcolour=productdetails.data.productquery.colours-->
Actually, if I just show this I get: [object Object],[object Object],[object Object]
Teodor
March 11, 2026, 10:29am
7
Can you simply post a screenshot of what your structure is for this server action/db query from the Network > XHR tab in the dev tools of your browser?
I think i I have gone mad with the queries replications…
Teodor
March 11, 2026, 10:57am
10
So you need to use the values formatter:
<meta name="keywords" id="colours" dmx-bind:content="productdetails.data.colourquery.values('colourName')">