chandler icon indicating copy to clipboard operation
chandler copied to clipboard

Templating for contact protocols

Open phorcys420 opened this issue 1 year ago • 5 comments

Currently, monica only supports prefix text.

as such, if the data is world and the protocol is hello:, then the final URI will be hello:world. what I'd like is a templating engine, where you could do https://somesite.com/%id%/profile

in the example of Discord, it would be something like : https://discord.com/users/%id%/profile. i have already needed that for another website, but I don't remember what it was.

phorcys420 avatar Mar 27 '23 19:03 phorcys420

Where would this feature be possible to implement? There is a significant possibility in scope.

Martijn-Bos avatar May 05 '23 13:05 Martijn-Bos

Where would this feature be possible to implement? There is a significant possibility in scope.

Hello, sorry, I don't understand your question. Can you maybe elaborate on what you mean ?

phorcys420 avatar May 05 '23 13:05 phorcys420

If I correctly understand there would be a set amount of possible templating tags that are transformable %contact_id% - id of contact. %gift_description% - description of a gift. %address_id% - id of address %postal_code% - postal code

Wherever a string will be presented in the frontend and within the context of that page it is possible to figure out which contact, gift or address(etc) is actually meant, the tag will be transformed to the actual data.

If you're looking at a contact page of Mahatma Gandhi, which has id 12 in your database it would be able to transform the following link: https://somesite.com/%contact_id%/profile Would become https://somesite.com/12/profile

For a lot of templating there is a specific need for context for the tags that need to be filled. If you're on a contact index page, you can't fill any contact_id since Chandler is not able to know which exact contact is meant.

As the idea is awesome I am wondering where you'd want this to be available and where it would be interesting to implement - every extra added tag and page where tagging is possible would increase the time investment needed.

Martijn-Bos avatar May 05 '23 13:05 Martijn-Bos

I don't think you understood it like I meant it.

if you go to /settings/personalize/contactInformationType on your chandler instance, you are able to add contact information types. (image)

Like that :

And that would format the link to be https://website.com/@/something/profile

In #459 I talked about something like adding in an "ID" field to the existing contact info stuff, that way you could distinguish name and ID.

phorcys420 avatar May 05 '23 13:05 phorcys420

I did indeed misunderstand. Seems like a great implementation.

Martijn-Bos avatar May 05 '23 13:05 Martijn-Bos