Skip to content

Commit

Permalink
Merge branch 'experimental' of https://github.com/gadgetchnnel/lovela…
Browse files Browse the repository at this point in the history
…ce-home-feed-card into experimental
  • Loading branch information
gadgetchnnel committed Oct 25, 2019
2 parents 836517f + 08fd292 commit ac825bc
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,27 @@ This would be rendered as [Post title](https://www.reddit.com/r/...)

### detail_template (optional)
This controls the content of the more-info popup when clicking on the item (if **more_info_on_tap** is enabled).
This works the same as the **content_template** option but, since it uses the built-in Markdown card, also supports Jinja2 templates.


This works the same as the **content_template** option but, since it uses the built-in Markdown card, also supports Jinja2 templates. The item properties can be used in the Jinja2 template via the **config.item** property, for example "{{ config.item.body }}". Here is an example with a Reddit sensor:

```
- entity: sensor.reddit_homeassistant
content_template: '{{title}}'
detail_template: >
{% if config.item.body != "" %}
{{ config.item.body }}
{% else %}
{% if config.item.url.endswith(".jpg") or config.item.url.endswith(".png") %}
![{{ config.item.title }}]({{ config.item.url }})
{% else %}
[{{ config.item.title }}]({{ config.item.url }})
{% endif %}
{% endif %}
[View on Reddit](https://www.reddit.com/r/homeassistant/comments/{{config.item.id }})
list_attribute: posts
max_items: 10
multiple_items: true
timestamp_property: created_utc
```

0 comments on commit ac825bc

Please sign in to comment.