document
A single platform-hosted document — a pdf, spreadsheet, or office file the visitor opens in the browser or downloads.
A single platform-hosted document — a pdf, spreadsheet, or office file the
visitor opens in the browser or downloads. The value resolves to one
DocumentValue (served url plus filename, type and size); render it with
Slot.Document, which is one anchor.
Reach for url({ accepts: "file" }) instead when the file lives somewhere
else — a Drive or Dropbox link the platform neither stores nor serves.
fill takes a documentAssign, which picks one file out of the documents
stored on the property. Usable standalone or as a list item — a
list.of(document(...)) carries its own listFill and picks a SET from the
same pool.
Import from @homepages/template-kit.
Signature
Section titled “Signature”function document(opts: DocumentOptions): DocumentSlotDef & FillMark<BuiltDecision<"document-assign">>Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
opts |
DocumentOptions |
required |
Returns
Section titled “Returns”DocumentSlotDef & FillMark<BuiltDecision<"document-assign">>
Example
Section titled “Example”import { document, documentAssign } from "@homepages/template-kit";
document({ label: "Offering brochure", fill: documentAssign({ pick: "The full property brochure." }) });