Is there a way to have a different custom element on each dynamic page. I have a custom element widget that the value needs to be a particular number depending on which item is being shown. The custom element box doesn’t let me link the value to a value in the content manager. Any ideas on how I could accomplish this?
You can get the item from the dataset and set it as an attribute of the custom element.
In the custom element you need to have:
static get observedAttributes() { return ['attibuteName']; }
and :
attributeChangedCallback(name, oldValue, newValue) {
//do something with the newValue
}
You can read more here:
How do I do this. Forgive me, I’m a novice with JSON.
Read the links I posted. It’s explained there.
Hey, i have this all connected but it doesnt load