Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Templating for contact protocols #458

Open
phorcys420 opened this issue Mar 27, 2023 · 5 comments
Open

Templating for contact protocols #458

phorcys420 opened this issue Mar 27, 2023 · 5 comments

Comments

@phorcys420
Copy link

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 phorcys420 changed the title Templating for protocols Templating for contact protocols Mar 27, 2023
@Martijn-Bos
Copy link

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

@phorcys420
Copy link
Author

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 ?

@Martijn-Bos
Copy link

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.

@phorcys420
Copy link
Author

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.

@Martijn-Bos
Copy link

I did indeed misunderstand. Seems like a great implementation.

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

No branches or pull requests

2 participants