Things I have tried
Does anyone know if there is a dataviewjs
equivalent of the following?
`=this.site.conditions.light`
Rendering to:
From linked file: GS-43HOLM-BACKYARD-LEFT
Containing:
---
tags: home/43-Holm
aliases: [GS-43HOLM-BACKYARD-LEFT]
season: 2023
description: [in the backyard, directly against the wall on the left]
created: [[2022-09-01]]
modified: <%+ tp.file.last_modified_date() %>
fits:
tray: [square]
spaces_available: 4
conditions:
light: [full sun]
wind: [sheltered]
vertical_restriction: [no height restrictions]
support: [pea sticks, netting, cane]
---
The code is being run in: GB-50-78L-02
Which contains the following YAML:
---
created: [[2022-09-01]]
tags: grow-bag
site: "[[GS-43HOLM-BACKYARD-LEFT]]"
season: 2023
dimensions:
height: 40
diameter: 50
pockets:
amount:
diameter:
tray: [square]
potting_mix:
selection:
manufacturer: "[[Elixir Gardens]]"
purchased: "[[Amazon]]"
---
When I run a regular dataview query, e.g.
```dataview
table final_size.spread AS spacing
from #variety and -"templates"
flatten this.site.conditions.light AS Light
flatten this.site.conditions.wind AS Wind
flatten this.site.conditions.support AS Support
where contains(row.parent.conditions.light, Light) and contains(row.final_size.support, Support)
```
The line this.site.conditions.light
is read correctly - meaning that the system navigates from the current note (GB-50-78L-02) to the linked note (GS-43HOLM-BACKYARD-LEFT) and retrieves the subsequent YAML metadata.
Running this:
dv.paragraph(dv.current().file.frontmatter.site)
Returns a clickable link to the linked note:
However, the following variants all return an empty string:
```dataviewjs
dv.paragraph(dv.page(dv.current().file.frontmatter.site))
dv.paragraph(await dv.io.load(dv.current().file.frontmatter.site))
```
What I’m trying to do
Extract YAML contents from another file (linked to this one via frontmatter).