This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Use Content Block/🌈 Content block dynamic query_20201117112518-dott91x.sy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Dynamic query embed syntax | ||
|
||
The syntax of the content block dynamic query embed is: | ||
|
||
```sql | ||
!{{ SELECT * FROM blocks WHERE content LIKE '%content block%' }} | ||
``` | ||
|
||
It needs to be used on its own line. The script syntax used is SQL. For details, please refer to ((20201117103851-gx21lz6 "here")). | ||
|
||
### Example | ||
|
||
* Query list items that contain `content block`: | ||
|
||
```sql | ||
!{{ SELECT * FROM blocks WHERE content LIKE '%content block%' AND type = 'NodeListItem' }} | ||
``` | ||
* The query content contains both `content block` and `reference` paragraph blocks: | ||
|
||
```sql | ||
!{{ SELECT * FROM blocks WHERE content LIKE'%content block%' AND content LIKE'%reference%' }} | ||
``` | ||
* The query content contains title blocks of both `content block` and `embed`, and the first 2 items are selected in descending order of time: | ||
|
||
```sql | ||
!{{ SELECT * FROM blocks WHERE (content LIKE '%content block%' AND content LIKE '%embed%') AND type ='NodeHeading' ORDER BY block_id DESC LIMIT 4 }} | ||
``` |