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

Overriding the current default template #88

Open
ChenRen93 opened this issue Apr 12, 2022 · 3 comments
Open

Overriding the current default template #88

ChenRen93 opened this issue Apr 12, 2022 · 3 comments

Comments

@ChenRen93
Copy link

Hi, I am currently working on the creation of a template renderer. However, I have an issue trying to override the current default template. I have looked through the codebase and could not find any way for us to override it other than cloning and modifying the current repository. I would like to ask if we could include validation to check for a custom default template availability?

@simboonlong
Copy link
Contributor

simboonlong commented Apr 26, 2022

u have a repo to see? so this file is what u want to overwrite, like to show a customised default look yeah?

@ChenRen93
Copy link
Author

ChenRen93 commented May 6, 2022

Sorry Boon, I didn't receive notification from ur replies. I don't have a repo for viewing, the rough explanation and code digging, show that the current key registry selector points towards the component default template if the registry is not found. I was thinking of adding an additional selector that allows the user to override the default template shown in the code snippet below. By adding additional checks below we can just include CustomDefault as one of the key registries to override the current default template. Is this idea feasible?

Example like :
const selectedTemplate: TemplateWithComponent[] = (templateName && templateRegistry[templateName]) || templateRegistry.CustomDefault || [defaultTemplate];

reference:

const selectedTemplate: TemplateWithComponent[] = (templateName && templateRegistry[templateName]) || [

@simboonlong
Copy link
Contributor

ic, can do as templateRegistry.DEFAULT i guess. pr welcome 😂

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