lektor-website/content/docs/api/db/query/include-hidden/contents.lr

31 lines
814 B
Plaintext
Raw Normal View History

2015-12-19 14:52:17 +01:00
title: include_hidden
---
summary: Changes the query so that it includes or does not include hidden records.
---
type: method
---
signature: value
---
body:
This controls how the query should behave with regards to hidden records.
A query created from the [children :ref](../../record/children/) attribute of
2015-12-26 00:35:25 +01:00
a record will not include hidden records (or undiscoverable) by default. The
opposite is true for queries created from the [query :ref](../../pad/query/)
method of the pad.
2015-12-19 14:52:17 +01:00
The parameter can be set to `True` to include hidden or `False` to exclude
hidden records.
## Example
Here a basic example of how to filter something in a template:
```html+jinja
<ul>
{% for item in this.children.include_hidden(true) %}
<li>{{ item.title }}{% if item.is_hidden %} (hidden){% endif %}
{% endfor %}
</ul>
```