Is it possible to add scripts into a widget template


  • Anime Lovers

    I have a widget template called "carousel-3d.tpl", and because carousel-3d depends on jquery, modenizr and other front-end components, I guess is there any way to add scripts into this widget? I tried, but never able to render extends->widgets page, it freezes. I know I am a newbie, does anyone could help me solve this problem?


  • Admin

    You could try adding those scripts in the Custom Header section from an external CDN


  • Community Rep

    You say extends->widgets freezes, if you are trying to render the widget in the ACP, you may need to add the dependent scripts to the acpScripts section of your plugin.json

    I don't think the Custom Header is executed in the ACP.


  • Anime Lovers

    @psychobunny Custom header is a way, but not good enough, in fact I am writing a plugin which act somewhat like nodebb-plugin-widgets-essential, that is to add one of our custom widget.


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.