-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Short description of the enhancement
Be able to add attributes to script tags in admin theme.
Optional: Steps that explain the enhancement
Hi @ryancramerdesign !
Recently had a conversation with a couple forum members on the topic of being able to add attributes to script tags. This issue came about when talking about using Alpine.js for the development of a ProcessWire Inputfield, and the requirement of Alpine to be installed with the deferred attribute.
I am not sure is this is the right approach to make the tags output configurable but nonetheless decided to give it a shot, as one of the forum members (kongondo) proposed.
So in the Inputfield modules we could do something like:
public function renderReady(Inputfield $parent = null, $renderValueMode = false){
$this->config->scripts->add("https://unpkg.com/alpinejs@3.10.2/dist/cdn.min.js",
['defer' => true]
);
parent::renderReady($parent, $renderValueMode);
}
szabeszg, jmartsch, teppokoivula, kongondo, jlahijani and 1 more
Metadata
Metadata
Assignees
Labels
No labels