Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted January 3, 20241 yr I want to embed a content in ckEditor, this content has a controller. i added this controller to the `Allowed javascript controllers` option. but it doesn't work and the controller doesn't load. what should i do? I added the controller name with this structure in `Allowed javascript controllers` option: valaapp.front.vala.valajsfile the folder structure is : js->front->controllers->vala->ips.vala.valajsfile.js
January 3, 20241 yr Author In fact, the program has the following: - Sources -> Class -> MyClass extends \IPS\Content\Item Implements \IPS\Content\Embeddable - .phtml file that has a data-controller attribute I guess everything is set up (I followed the embedded blog structure), I also checked all the structures of the other IPS apps, unfortunately, none of them had a controller in their embedded file.
January 3, 20241 yr Author Yes in embedContent() function, before returning the embedded template, I added CSS and JS files to the Output Class, CSS and JS don't work: \IPS\Output::i()->cssFiles = array_merge(.....) \IPS\Output::i()->jsFiles = array_merge(.....)
January 3, 20241 yr OK - I'm not going to get the full picture with such small bits of information so here's a quick working example (dev folder and tar included in zip - now deleted) Install the application on your test site In your editor settings, add jscontroller.test to the allowed javascript controllers Create a post, add the following as the HTML (via the source) <div data-controller="jscontroller.test">TEST</div> Submit the post. Result: Edited January 3, 20241 yr by Nathan Explosion