Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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(.....)

Posted (edited)

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:

 

Could contain: Text

 

Edited by Nathan Explosion
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...