#show outline only if there is content

15 messages · Page 1 of 1 (latest)

thorn jetty
#

I have this outline for images used:

outline(title: "Abbildungsverzeichnis", indent: true, target: figure.where(kind: image))

It is in one of my templates. I want to only show it, if there are images. How could I do that?

molten urchin
#

you can check with a query

#

?r

#context if query(figure.where(kind: image)).len() > 0 {
  outline(title: "Abbildungsverzeichnis", indent: true, target: figure.where(kind: image))
}



#figure(rect(), kind: image, caption: "x")
molten urchin
#

?r

#context if query(figure.where(kind: image)).len() > 0 {
  outline(title: "Abbildungsverzeichnis", indent: true, target: figure.where(kind: image))
}



// #figure(rect(), kind: image, caption: "x")
thorn jetty
#

Thanks @molten urchin

thorn jetty
molten urchin
#

you cant currently invert a where clause no

thorn jetty
#

alright.

molten urchin
#

you can and or or them though

thorn jetty
molten urchin
#

figure.where(kind: table).or(figure.where(kind: raw))

thorn jetty
#

oki doki