Ability to insert Relations Inline with text

Would be very cool if relations could be displayed inline.

For example, the author of a book is a relation.

Now I want to make a text as following: “as {author} wrote, …”

For displaying would be nice too if it was possible to add an author icon which is displayed left to the name. But even without icon would be nice.

Important is the autofill (when used as template) and that it is clickable :slight_smile:

25 Likes

@wemiprog What belongs to this too, I think things like thumbnail images should be possible to display them like a general image. Would make them way more useful

Is your feature request related to a problem? Please describe.

Currently, the relations added inside a page using the /{relation-name} inserts the relation and its value as a special relation block which makes it possible to edit the relations value from within the page.

However, this behavior limits the use of the relations from inside the page. It would be great if the relation’s value are treated as a normal value instead of a special block which would supercharge the usage of relations inside the page

Describe the solution you’d like

When the user types /{relation-name}, instead of displaying the relation block with the relation name - value format, it would be great if only the value from the relation is fetched and displayed. The value of the relation should be updated / kept in sync with the relation. So when the value of the relation is changed, the place in which the relation’s value is used in the page should also be changed. This is like Transclusion but for relations and not blocks.

Examples

  • Embedded Attachments

This request would enable the possibility to add an image / music / [videos / GIFs](Inline .gif files or videos? - Feature Requests - Anytype Community) from the attachment relation to be embedded inside a page which should enable one to display them / play them. With more [file previews](View files in File Set preview within Anytype) for docx, [PDF](Embed PDFs ), etc. this would enable one to view the documents from within the page instead of downloading it from the relation

  • Dynamic Documents

After [formulas](Derived Relations ( Formulas )) are implemented, this feature also enables one to embed derived relations (i.e formulas) inside pages which gets updated with the formula getting update. This would help one to achieve what is called as a Dynamic document as requested in this [feature request](Add in-line calculations, the power of Excel but in free text (like Patera)). So a due date can be displayed inside a page and will be updated when the due date relation is updated.

  • Website relation as Bookmarks

As in this [request](Possibility to use relations as media in templates), this feature would enable one to use the website URL inside a bookmark block which should enable one to display the preview for the website from within the page. The bookmark should also need to be update when the value is changed in the relation

  • Inline Tags

Say a page has several tags. For example, One page I have which lists the tweaks I usually apply for Firefox browser which contains two tags named - Privacy and Customization

With the current implementation, I cannot add a separate tag to each heading, but with the feature getting implemented, I could add the Privacy tag to the user.js heading and so which should enable one to further categorize their pages. Something like this,

Along with this [feature request](Multilayer text annotation objects), this should enable one to later filter a page to display only contents matching a particular tag

However, there are several quirks that needs to be ironed out before this feature gets implemented;

For example:

    1. What happens for a relation with Multi-Values?

One possibility is to provide a pop-up for the user to select the values to be displayed or to display all the values. However, keeping this in sync with the relation needs some thinking as to, what happens when a single value from a multi valued relation is deleted?

    1. What happens when a relation is deleted?

One possibility I could think of to tackle both the above issues is to have a place holder displaying the value is deleted in the place where the relation was previously referenced with a grey background and grey foreground to give a unknown value feel to the user which should hint them to update it later.

A relation when added to a plain page should be displayed differently than the plain text, possibly with a different background and foreground color. But when the relation is added to a block, it should be used as just another input only with the extra ability to be in sync with the relations value.

One implementation possibility I could think of is to use a special markup for the relations when used inside other blocks. So if I have a relation named main-website which has a URL and is added to the bookmark block, internally it could be marked as <rel-main-website>www.anytype.io</rel-main-website> This should allow anytype to know that it is a relation value that is to be kept in sync with the relation named main-website. This should also enable one to theme them differently when they are used inside a page, all tags starting with rel will have a background color, the background and foreground color is unique to each relation name that follows the rel- name

P.S This is a more detailed request for the comment of @qualquertipo from this [thread](Add in-line calculations, the power of Excel but in free text (like Patera))

I’m not sure if we should keep this as a separate request or merge it into the linked thread as this feature would be required for the other linked requests to come to fruition :sweat_smile:

Also from the comment, I’ve got a better name for the request: Treat Relations as Synced Inline Value. It would be great if any of the Mods could rename the thread to the new name

15 Likes

Awesome!

Maybe break this up into multiple requests?

Small detail: I personally think calling the inline relations “text” reads as “plain text”, when it’s really much richer than that. But maybe this is just me…

Anyway, great ideas/requests there. Thanks for expanding on these.

True, text sounds like “plain text” to me as well :sweat_smile: I’ve updated the main post now to request for the title to be changed to "Treat Relations as Synced Inline Value"

All the examples have separate feature requests already. I’ve used them as examples just to give us an idea of the possibilities that would be available if this feature gets implemented. Only the Inline Tags feature is not available but that should be immediately possible if this gets implemented.

1 Like

@div3xi Just came across this [thread](Ability to insert Relations Inline with text) which request the same albeit in much simpler terms, but I feel that we should merge my request into the original one to reduce duplicates :grinning:

I would also love the ability to call other Objects’ relations through a method like this. For example, I could be writing an Object that’s a freeform Article, but be able to reference a particular Book Object inline, as well as call that Book Object’s Author relation.

I imagine that could look similar to what’s proposed above, where /{author} would access the Author relation for the given Object, but /{Object:Author} could load another Object’s Author relation. Perhaps a prompt when the user types /{ listing the current Object’s relations, but adding an option at the bottom to search for another Object?

3 Likes

It would be really useful.