Searches for a specified placeholder and either adds text above, below, or replaces it entirely.
A "placeholder" is a one-line comment: a piece of text enclosed in double percent signs, e.g. %%My Placeholder%%
. Since Obsidian does not render the comment outside of edit mode, it is perfect for marking places in a document where text can be added later.
The "%%placeholder%%" style is used in the body of the note, the "#placeholder#" style is used in the frontmatter (which is YAML and not compatible with Markdown's percent style).
If the placeholder parameter doesn't contain any delimiters (i.e., if the double percent or the hash sign is missing), the action will enclose the placeholder in double percent signs. However, it is recommended not to omit them.
This action will throw an error if there isn't a Periodic Note for the current date, so it's best to use it after the "Check For Existence Of Periodic Note" action has determined that there is one.
Parameters
Vault
The vault to work in.
Type: Vault reference
Periodic Note Lookup
Options:
- Daily Note
- Weekly Note
- Monthly Note
- Quarterly Note
- Yearly Note
Placeholder
A "placeholder" is a one-line comment in a Markdown note: a piece of text enclosed in double percent signs, e.g. %%My Placeholder%%
. Since Obsidian does not render the comment outside of edit mode, it is perfect for marking places in a document where text can be added later.
Use the %%placeholder%%
style in the body of the note, and the #placeholder#
style in the frontmatter (which is YAML and not compatible with Markdown's percent style).
If the placeholder parameter doesn't contain any delimiters (i.e., if the double percent or the hash sign is missing), the action will enclose the placeholder in double percent signs. However, it is recommended not to omit them.
Type: Text
Replacement
The replacement text, i.e. the piece of text you want in your note instead of the placeholder.
Type: Text
Allow empty replacement
When enabled, your replacement can be blank, which would effectively just remove the placeholder from the note.
Type: Boolean (YES
/NO
)
Where should the text be inserted?
The text can be placed above the placeholder, below it or it can replace the placeholder entirely.
Hint: When adding items to a list, and you want to add new items to the end of the list, select "above placeholder"; if new items are supposed to go to the top of the list, select "below placeholder".
Options:
- above placeholder
- below placeholder
- replace placeholder
Open or focus note
If enabled, after a successful operation, the note will be brought to the front in Obsidian.
Type: Boolean (YES
/NO
)
Examples
Suppose your current daily note sports the following content and a placeholder %%placeholder1%%
. We'll insert the texts text 1
, text 2
, and text 3
in sequence.
Inserting above the placeholder
The result would be:
Inserting below the placeholder
The result would be:
This is because after text 1
is inserted, text 2
is placed directly below the placeholder (as it should be), i.e. in-between the placeholder and text 1
.
Replacing the placeholder
The result this time:
The first insertion replaced the placeholder, and text 2
and text 3
have nowhere to go.
Related Links
- Search the Actions for Obsidian community forum for "Insert Text At Placeholder In Periodic Note"