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

Allow for multiple templates on a single page #1

Closed
daviddarnes opened this issue Apr 12, 2024 · 0 comments
Closed

Allow for multiple templates on a single page #1

daviddarnes opened this issue Apr 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@daviddarnes
Copy link
Owner

Is your feature request related to a problem? Please describe.
It would be great if more than one template could be used on a single page. Right now if you want to use a custom template all instances of link-peek will use the exact same template with the ID of link-peek-template.

Describe the solution you'd like
Same behaviour as before but you could override the ID that the component looks for when using a custom template. Here's a sudo code example:

<template id="my-custom-template">
  <blockquote data-key="content"></blockquote>
</template>

<link-peek api="https://api.microlink.io/?url=${link}">
  <a href="https://darn.es">David Darnes</a>
</link-peek>

Any instance without the template attribute would either use the default template within the component or, if there is one, the template with an ID of link-peek-template. This would mean there would be no breaking changes to peoples usage of the component.

@daviddarnes daviddarnes added the enhancement New feature or request label Apr 12, 2024
@daviddarnes daviddarnes self-assigned this Apr 12, 2024
daviddarnes added a commit that referenced this issue Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant