marcusolsson/obsidian-projects

Add template in plugin options

Opened this issue · 3 comments

What would you like to be added?

I would like to have the ability to have a template that is used for all my projects. If there were an Options setting for the plugin like other plugins have where I can put a standard template for all of the actions in the project. Also, if there was a place to maybe have a description for the project that would be awesome.

Why is this needed?

Because if I am going to use the same template in every project, then it seems redundant to have to add it every time to my projects. it would be nice to have a description or a place to add notes to the project, so I can also add notes about the project like why am I doing it and reflect on it afterwards, that would be very helpful.

Thank you for the suggestion 🙏 I can see the need for this.

Thank you for your work on this. I saw the video with Nicole van der Hoeven which was immensely helpful. It was so great to see how this can be implemented in ways I would have never thought of. I am so excited to update some of my workflows.

Hello! Bumping this with some extra thoughts; the lack of project templates in addition to the inability to change field types after creation and the project folder creation bug means that there's a lot of unnecessary overhead in making a project for managing simple tasks with a kanban board.

Example use case: a project managing tasks with a status (Todo, In progress, Done) with a kanban view
image

Steps to create project (with obsidian-projects v1.17.1):

  1. Create a project with Projects: Create new project, e.g. Chores, with a note template including the frontmatter
# projects/templates/task.md
---
Status: Todo
---
  1. Create a corresponding folder to manage the project, e.g. projects/chores
  2. In the project table (current default) view for Chores, add a few note tasks (i.e. to marinate tofu) , freeze tofu, make marinade, marinate tofu.
  3. Give the tasks the variety of Status options you want (ie Todo, In progress, Done). Because the type inference from the templatized note above infers Status as a string, it can't know it's an enum (i.e a field with Options) and provide autocompletion in the table view. Without project templates, you can't make an enum field without you manually deleting the Status field, and then re-adding it from the table view with the UI wizard.
  4. Create a board view, select Status to be the view's Status field, and reorder the columns.

Insights

I think the main insight from this discussion is that projects (which are really just collection of views) should be derived from template files. You could even make active projects declared in user-visible files, like the approach taken by the Database Folder plugin, at the risk of users borking their own projects by modifying the text.

What should go in the project template files?

  • To reduce the hassle of making enum fields, project templates should include note templates with types. An example of a project template including a note template might be
# projects/templates/task-project.yaml
name: "Task project with kanban"
metadata-type:
  Status: "Todo" | "In progress" | "Done" # written in some DSL of your new type system
note-templates:
  - projects/templates/task.md
# projects/templates/task-project.yaml
views:
- name: Kanban
  type: Board
  Status: Status
  columns:
    - Todo
    - In progress
    - Done
- name: Table
  type: Table

Also, if there was a place to maybe have a description for the project that would be awesome.

  • Any other properties added to projects, like an overarching description or cover photo, should also be declarable in project template files.

I hope these thoughts are helpful for the development of this plugin, and the next iteration of its type system. Thanks for all your amazing work so far! 😊