Type schema

WHAT IS THE ISSUE

AnyType’s management of relations add a huge penalty is you don’t properly think them ahead, because if you forgot to add a relation during the template creation, you cannot batch add them, you will have to add them one by one.

WHAT DO YOU RECOMMEND

I would like the possibility to have something like a schema belonging to the type, where if I add a new relation, all the objects of the same type will receive that relation.
I think this should be an addition instead of substitution to the current approach of adding relations wherever you want. So those who want a workflow based on templates can have it and those of us who prefer structure can have it too.

HOW COULD IT BE DONE

Even though this FR is about the schema, I was flirting with the idea of multi-types too, and I think that this could be a great stating point.


All the properties inside the light gray area are relations that belong to the type schema and the ones below only belong to the object. You can create schema relation pressing the Add relation button while the inline relation can still be created using the / command.

REAL WORLD USE CASES

I want to implement spoken languages to the human type. Because this was an afterthought, I would have to add them one by one in all the already created types, with this feature I only have to add them to the schema, and I will fix this problem.

RECOMMENDED ALTERNATIVES

  • Over think the system so I don’t have to deal with this. :thinking:
  • Delete everything and start all over again.
  • Add the relation to the type set instead so I can “batch” edit them all. (It won’t be present in the page itself, though :confused:)

ADDITIONAL CONTEXT

Highly related.

Featured relations should be managed through types, not templates - Feature Requests - Anytype Community

Cascading relation changs from types to all objects - Feature Requests - Anytype Community

Difficult to create/modify types and properties (~Notion database properties) - General Discussion - Anytype Community

Somewhat related. (Specially the multy-type thingy)

Type Composition - Objects of multiple types - Feature Requests - Anytype Community

Sub-Types - Feature Requests - Anytype Community

Somewhat related. (Batch updating at the template level)

How can I create a Template? What are Templates used for? - General Discussion - Anytype Community

Option to apply template to an existing object - Feature Requests - Anytype Community

Nice!

Related: check out my comment here, and the replies.

This might be one of the most important things said on this forum! Hope they add a solution for this.

I can’t wrap my head around the idea of this being implemented at the template level. I mean… how would that even work?

  • If you create an object but you change it so much that it can be consider “its own template”. How would the conflict resolution be when you change something inside its template?
  • If you add something new to the template. How would this changes be linked to the template when you have modified the objects created with it?

I guess this is manageable with a couple of objects with an option Do not apply changes to this objects. but what when you have hundreds of objects and you need to update dozens of them.

Anyway…
Have you tried Coda or Capacities? In this apps, the canvas is a property itself, if you don’t add a canvas (in Coda) or Blocks (in Capacities) property to your database you won’t be able to add content to the page.


I can’t add content to this book type.
image
I have to create a blocks type to add content.

Now I can add some content, import info or use this object’s templates.

Is something like this what you want when you talk about changes to the template?
Because I can totally see the possibility of adding a new “blocks” property (you can add many of them) with its own content and see it reflected in all the pages, but this the current approach I cannot see how to do it without risking user’s data.

Sorry if I sound condescending, rude or plain pedantic. English is not my mother tongue and I still struggle with that. I would really like to read your opinions about this.

I agree, template control seems like an odd approach. I believe the point is to have ability to apply relations batch-wise. This seems like a job for Sets to apply. Maybe the commenter can correct me if I’m wrong.

I completely understand your question. It’s definitely not a simple task!

A way to explain what I said is starting from a simple case.

Let’s say I have a simple book template, with 2 columns of equal width.
First column has the image of the book cover, second cover has a few relations.

After creating 100 books using that template, I realize that I’d like the book cover to be bigger.
So I go to the template, and adjust the column widths, so the cover one is wider.

If I then open any of the existing books, they’ll show this new layout!

Of course, things might get tricky as these changes get more complex.

For example, what happens if you remove an element from the template? (My take: check if any of the objects have content in that element. If yes, warn user)

Other obstacles probably exist. These would need to be addressed.

Edit: by the way, Anytype team themselves have commented on my suggestion (in the post I sent the link to), and stated that this is indeed their objective :+1:

Not sure if your post was directed to me, but thanks for the explanation. Glad to hear this is being addressed, or at least an objective.

This was also a question of mine. I guess in theory changing templates could be done by a new template by mapping values from one object to another — but I’m no developer, thank goodness.

Absolutely, something like this is what I want too. Everything inside the grey background should be synchronize with its types.

This is exactly my concern and the reason I wanted to know the scope of this.

I disagree in this one and is exactly the reason why I did this FR, I think the scope of templates should just be in the initial creation of the type, nothing more. I don’t buy on the idea of “Live Templates” (at least right now and just because I might not be understanding it). You could replicate the exact same layout of the example above inside the canvas in a template and every single modification work at the object level. That’s how I think it should work. Flexibility and structure at the same time.

Yeah. I read several comments about it, one including that after Inline Sets were released, they will re-think the whole functionality of templates, my biggest concern is that they were talking about templates instead of just properties/relations.

I am just seeing the whole potential that AT can have in my life that I am kind of afraid that the relation management become a dealbreaker to me. I mean this is the only reason I am not using AT actively right now; I don’t want to create a bunch of objects if then I will have to update them one by one.

edit: hope we got to see something about this on this Thursday Townhall.