!include Lovelace UI editor

Hi, I’m using the same browser popup on different Lovelace page. I was wondering if it could be possible to save this code somewhere and call it from the Lovelace editor ( maybe in the code editor ? )

I try to do it but the Lovelace editor throw me a lot of error so … can anyone help me ?

Thanks

!include doesn’t work in UI Edtor, which is why you’re getting the error. So either keep using UI Editor and don’t use !include variable, or move to YAML mode and enjoy total freedom.

Perhaps you can use the Raw Configuration Editor, which is kinda like YAML mode, while still having the UI Editor. Then use that to create and edit !include variables.

I don’t think (as in I’m pretty sure and almost positive…) it won’t work.

THe UI editors are designed to be one massive monolithic file containing everything related to the editor function (lovelace, automations, scripts) and so aren’t meant to be used the way you want.