Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic template label #35

Open
HanXJ-Dev opened this issue Jan 13, 2023 · 3 comments
Open

Dynamic template label #35

HanXJ-Dev opened this issue Jan 13, 2023 · 3 comments

Comments

@HanXJ-Dev
Copy link

Currently, the label value displayed on TradeTrust verify is dependent on a hardcoded value under decentralized-renderer-react-template/src/templates/index.tsx which in this case it is "Red Custom Template".

Could there be a new feature where the label can be dynamically set from the tt/json file that has been uploaded?

My current way of displaying the form is dynamic, however, it still requires duplication of files for different labels.

Thanks in advance!

@simboonlong
Copy link
Contributor

if u can share repo in what you wanna achieve will be great. there is a utility function getData in open-attestation if that's what you are looking for

@HanXJ-Dev
Copy link
Author

Hi, unfortunately the repo of the renderer cannot be shared, but located in decentralized-renderer-react-template/src/templates/<templatefolder>/index.tsx
image
The label value is hardcoded. For the getData utility function, it still requires us to have access to the wrapped document, but in this scenario is it possible to get the wrapped document?

@simboonlong
Copy link
Contributor

there are reasons on the need to duplicate templates for a single renderer:

  • you retain backward compatibility for your previous issued documents (will still be able to render old documents)
  • you'll have flexibility to "update" templates by creating a new one, should your data schema changed one day

am afraid i still don't really understand the need for dynamic use case 🤔, if you could provide a watered-down repo will be awesome

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

No branches or pull requests

2 participants