Clarify documentation on hidden records

This clarifies the documentation regarding the default
value for a records _hidden field.
This commit is contained in:
Jeff Dairiki 2022-07-27 09:01:03 -07:00
parent 486092de24
commit 7a6ccd0e38
3 changed files with 18 additions and 8 deletions

View File

@ -7,11 +7,18 @@ type: sysfield
body: body:
This field controls if Lektor should process the page into a build artifact. This field controls if Lektor should process the page into a build artifact.
By default each page is built into a build artifact (HTML page) and each By default, each page is built into a build artifact (HTML page) and each
attachment is processed. This can be prevented by setting `_hidden` to `yes`. attachment is copied to the output directory.
This can be prevented for a particular page or attachment by setting its `_hidden` to `yes`.
This also automatically applies to all children of a page unless they If an explicit value for the `_hidden` field is not set, the value of the `hidden` option in the
forcefully override this setting. [child configuration] — or, for attachments, [attachment configuration] — section
of the parent's datamodel is checked.
If that, too, is not set, then pages, but not attachments, inherit the hidden status of their parent —
that is, by default, children of hidden pages will not be built, though attachments of hidden pages will.
[child configuration]: https://www.getlektor.com/docs/models/children/#child-configuration (The [children] section of the datamodel)
[attachment configuration]: https://www.getlektor.com/docs/models/attachments/ (The [attachments] section of the datamodel)
This is useful for more advanced setups like [Single Page Applications This is useful for more advanced setups like [Single Page Applications
:ref](../../../../guides/single-page/). :ref](../../../../guides/single-page/).

View File

@ -13,9 +13,9 @@ There are a few settings to control these in the `[attachments]` section:
* `model`: an optional default model that is used for all attachments. * `model`: an optional default model that is used for all attachments.
* `order_by`: controls the ordering of attachments, similar to how this * `order_by`: controls the ordering of attachments, similar to how this
works for child pages. works for child pages.
* `hidden`: if this is set it can override the hidden flag for all * `hidden`: if this is set, attachments will not be built.
attachments at once. The default as of Lektor 2 is that attachments are (Note that any setting here may be overridden on a per attachment basis by
not hidden by default. setting that attachment's [`_hidden` field](https://www.getlektor.com/docs/models/attachments/).)
!! The `hidden` flag was added in Lektor 2.0 and the default was changed so !! The `hidden` flag was added in Lektor 2.0 and the default was changed so
that attachments are not hidden by default, even if the parent is. that attachments are not hidden by default, even if the parent is.

View File

@ -40,7 +40,10 @@ Here are the most important options below `[children]`:
- `hidden`: if this is set it can override the parent's hidden flag for - `hidden`: if this is set it can override the parent's hidden flag for
all children. This is particularly useful if you want to have a folder all children. This is particularly useful if you want to have a folder
for error pages or other special pages where the parent itself should not for error pages or other special pages where the parent itself should not
be rendered but all children are. The default is not set. be rendered but all children should. The default is not set.
(Note that an explicit value for a
[child's `_hidden` field](/docs/api/db/system-fields/hidden/) will
override any value set here.)
!! The `hidden` flag was added in Lektor 2.0 !! The `hidden` flag was added in Lektor 2.0