Closed AndrewEHarding closed 4 years ago
Hi @AndrewEHarding,
Please don't link internal conversations on github and rather explain the issue + motivation here on github so that everyone can see what the issue is about and so that it can be easily trackable in future.
I went through the conversation and I'm not sure there is any value in extending the documentation as the function is called within the context of a particular linked item and if there is no linked item, it seems quite clear it won't be called.
@Enngage
I went through the conversation and I'm not sure there is any value in extending the documentation as the function is called within the context of a particular linked item and if there is no linked item, it seems quite clear it won't be called.
In my opinion the last part is only true if you have a deeper understanding of the system. Only in the code-comment something is stated about linked items:
In my case I just copied and pasted the code into my project and was expecting the "richTextResolver" callback to be triggered ALWAYS. When it did not i was doubting that my code was wrong and started to make all kind of code changes (especially because the code examples are in typescript). Only after looking at the kentico-vue-sample app i figured out that richtextresolver-callback is only triggerd if there is an linked-content item added to the richtext. Once you know it, it makes sense, i agree about that. But it would have been helpfull if this would have been written in the docs more explicitly. And maybe it would have made more sense to name the callback something like linkedContentItemsResolver. It took me several hours to figure things out.
Motivation
A customer on intercom was having some trouble following the documentation for the repo and suggested an edit that might have saved them some time.
Proposed solution
To quote: "Maybe this should be added to the documentation: https://github.com/Kentico/kontent-delivery-sdk-js/blob/master/DOCS.md#globally"
Additional context
Intercom conversation: https://app.intercom.io/a/apps/e42kus8l/inbox/inbox/3028365/conversations/24646083447