Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Adrian A. Posted March 12, 2018 Posted March 12, 2018 Greetings folks, So basically i have this app which does some modifications into the Forums app and also allows to use some widgets on any app, but i can't make CSS to load, it loads only on my app page. I tried making use of the developers page but wasn't really so helpful. Could someone give me some guidance of how should i proceed?
CodingJungle Posted March 12, 2018 Posted March 12, 2018 you would need to create a hook into the apps controller execute method (for forums you have the topic.php/forum.php, index.php), so the hook should look something like this: public function execute(){ parent::execute(); \IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles,\IPS\Theme::i()->css( 'mycss.css', 'myapp', 'front' ) ); }
Adrian A. Posted March 12, 2018 Author Posted March 12, 2018 Damn, it's just... amazing how i didn't think about this. Thanks! xD
Martin A. Posted March 13, 2018 Posted March 13, 2018 13 hours ago, CodingJungle said: you would need to create a hook into the apps controller execute method (for forums you have the topic.php/forum.php, index.php), so the hook should look something like this: public function execute(){ parent::execute(); \IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles,\IPS\Theme::i()->css( 'mycss.css', 'myapp', 'front' ) ); } Better to use \IPS\Dispatcher\Front::finish(), if OP want this to be loaded globally on the front end.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.