Adding an "enabled" attribute to templates
This commit is contained in:
@@ -12,6 +12,7 @@ Live Template Widgets follow the same pattern as other [[Templates]] with a few
|
||||
* `type`: should be set to `widget:top` or `widget:bottom` depending on where you would like it to appear
|
||||
* `where`: should contain an [[Live Queries$expression]] that evaluates to true for the _pages_ you would like to apply this template to, usually this checks for a specific tag, but it can be any expression. Think of this as a `where` clause that should match for the pages this template is applied to.
|
||||
* `priority` (optional): in case you have multiple templates that have matching `where` expression, the one with the priority set to the lowest number wins.
|
||||
* `enabled` (defaults to `true`): in case you want to (temporarily) disable this template, set this to `false`.
|
||||
|
||||
# Example
|
||||
The following widget template applies to all pages tagged with `person` (see the `where`). It uses the [[!silverbullet.md/template/live/incoming]] template, to show all incomplete tasks that reference this particular page.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Slash templates allow you to define custom [[Slash Commands]] that expand “snippet style” templates inline.
|
||||
|
||||
# Definition
|
||||
You can define a slash template by creating a [[Templates|template page]] with a template tag and `trigger` attribute.
|
||||
You can define a slash template by creating a [[Templates|template page]] with a template tag and `trigger` attribute. If you’d like to (temporarily) disable the template, you can set the `enabled` attribute to `false`.
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ This is an attempt at collecting useful, reusable templates so you don’t have
|
||||
|
||||
While you may just copy & paste these templates to your own space, the most convenient ways to use them is using [[Federation]]. This will synchronize these templates into your space and make them available for use instantly.
|
||||
|
||||
To set this up, add the following this to your [[SETTINGS]]:
|
||||
To set this up, add the following to your [[SETTINGS]]:
|
||||
|
||||
```yaml
|
||||
federate:
|
||||
@@ -56,7 +56,7 @@ render [[template/documented-template]]
|
||||
```
|
||||
|
||||
# Live Widget Templates
|
||||
Use these to add [[Table of Contents]] and [[Linked Mentions]] to your pages.
|
||||
Use these to add various useful [[Live Template Widgets]] to your pages.
|
||||
|
||||
```query
|
||||
template
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: >
|
||||
Adds a convenient "Copy to my space" button to any
|
||||
template found via federation
|
||||
tags: template
|
||||
type: widget:bottom
|
||||
where: 'name =~ /^!/ and tags="template"'
|
||||
---
|
||||
# Template actions
|
||||
* {[Page: Copy|Copy to my space]}: use this template in your space by making a local copy of it (and tweaking it as you like)
|
||||
Reference in New Issue
Block a user