I can’t access nested user objects when I use handlebars
In my user object I have the relation to its campaign:
{
username: 'test'
campaign_id: 8,
campaign: {
name: 'test'
}
}
If I use string template engine, I can access {{$user.campaign.name}} object. However I I switch to handlebars engine, this object is gone.
I tried to log the object usin {{log $user}} and I saw only
{
username: 'test'
campaign_id: 8,
}
Environment
- NocoBase version: 1.6.33
- Database type and version: PostgreSQL
- OS: Railway,
- Deployment Methods: Docker
- Docker image version: nocobase/nocobase:latest
How To Reproduce
- Create relation field to user
- Create markdown block with handlebar engine
- add {{log $user}}
Expected behavior
If I use string engine, I see nested objects, I expect the same behaviour using handlebar.
I’ve read the documentatino https://docs.nocobase.com/handbook/ui/blocks/other-blocks/markdown
where it says:
Currently, Handlebars does not support preloading association data. Users need to explicitly configure the corresponding association fields in the data block to retrieve the relevant data during rendering.
But it still unclear how am I suppose to explicitly configure current user object
