XF 2.2 Accessing an array variable in a template that has '@' in its name?


Well-known member
I'm working on a widget that retrieves an JSON object and then in the template it loops through the items and builds a display. Not a problem there. The problem I'm running into is that one of the item values has an @ as part of its name and I can't quite get how to retrieve that value in the template. In the example, below, the associated dollar amount is retrieved with ${{$searchResult.sellingStatus.0.currentPrice.0.__value__|currency}} but trying ${{$searchResult.sellingStatus.0.currentPrice.0.@currencyId}} results in an error.

I've tried ${{$searchResult.sellingStatus.0.currentPrice.0.['@currencyId']}} and several deviations thereof but they all give an error when trying to save the template.

Suggestions? 🤔

Top Bottom