Jump to content

Loading my app css in other apps?


Adrian A.

Recommended Posts

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? 

Link to comment
Share on other sites

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' ) );
}

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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