Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add a template frontmatter setting to the create new note command #88

Open
Perchycs opened this issue Jun 3, 2024 · 2 comments

Comments

@Perchycs
Copy link

Perchycs commented Jun 3, 2024

I've been trying to make this work for a while, and as far as I can tell there isn't a way to achieve what I want easily.

Current Workflow

I have been using the extension to quickly create a 'fleeting note' which I can quickly fill the content of using the form for the create new note command. This works great!

Issue

I am wanting to add a 'created_date' field as frontmatter, because dataview's 'file.cdate' doesn't work well when syncing notes across multiple devices. The 'cdate' reflects the file's creation date on each device (ie. when it was synced to that device), which can differ from the actual note's creation date.

Current Limitations

Using the 'default note content' option:

  • If 'fill form with defaults' is enabled, the default frontmatter appears in the content box, which ends up looking cluttered.
  • If 'fill form with defaults' is disabled, the default value is overwritten when adding content.
  • Adding tags via the form results in the default frontmatter being added after the tags, causing formatting issues (example here).

Using the feature introduced from #14

Feature Requests

New Setting: Add a 'text to append to the beginning of the note' option, allowing users to input frontmatter or initial text (e.g., a templater command). This could function like the similarly named option for the 'append task' command.
Tag Handling: Ensure that any tags selected in the form are integrated into this frontmatter, avoiding multiple frontmatter blocks. This might reduce the relevance of the 'default tags' setting, as users can add a 'tags: [your_tag]' field in the appended text.


Thanks so much, really appreciate the work you have done to create & improve this extension, it is such a useful addition to Obsidian!

@KevinBatdorf
Copy link
Owner

If 'fill form with defaults' is disabled, the default value is overwritten when adding content.

Do you think this is a bug? Where the content should show be there? Seems like it could be to me.

@Perchycs
Copy link
Author

Perchycs commented Jun 4, 2024

Hard to say, I feel like it was intended like that, as it is the 'default' content, so if you create a note with nothing in the content field, then the default content will be selected.

Makes sense to have this for a default note title, though I am not sure it necessarily makes as much sense with the note content, as I can't see any use for creating a note with the same default content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants