How can I access .Site.Data from inside a range?

I’m trying to access a .Site.Data variable from within a range. It works when I don’t have it inside the range, but apparently my context is changing.

The build fails with this error:

can't evaluate field Site in type []interface

I have some data inside the grid that is specific to the list item and other data that is generic and coming from a data file. The generic data is causing the error.


That does not seem to help. :confused:

If you want more help, please provide a more complete picture.

Sorry, I’ll try to explain better. I will condense my code to portray what is happening.

{{ range ((index $.Site.Data.project  .File.BaseFileName).epics) }}

<script type="text/javascript">

    $(function () {
        setSiteWideParm({{ $.Site.Data.bullet.color }});
        setInstanceSpecificParm( {{ . }});
{{ end }}

Having a $ in front of .Site does not seem to have any impact. I get the same error.

The condensed code looks correct, so I guess you have to post the complete code for us to be able to help.