Dashlet option for custom CSS?

This support forum board is for questions relating to Nagios Fusion.
Locked
TBT
Posts: 615
Joined: Wed May 18, 2011 1:26 pm

Dashlet option for custom CSS?

Post by TBT »

Developing a custom Dashlet, is there a Dashlet Option which allows the reference of a CSS file, rather than using an import rule in the Nagios Fusion CSS?

I'd prefer to keep all associated files in their respective custom Dashlet directories. Please advise.
Nagios XI 5.9.1 (8 Servers)
Nagios Fusion 2024R1.0.2
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Dashlet option for custom CSS?

Post by scottwilkerson »

Fusion doesn't have the DASHLET_CSS_FILE directive like XI does although I am going to make a feature request to add it.

For the time being I would hardcode the css line as part of the html output for the dashlet, using the path to the dashlet directory in the path, something like this:

Code: Select all

$output .= "<link rel='stylesheet' type='text/css' href='" . get_base_url() . "includes/dashlets/" . $args[DASHLET_NAME] . "/YOUR_CSS_FILE.css"' />\n";
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
TBT
Posts: 615
Joined: Wed May 18, 2011 1:26 pm

Re: Dashlet option for custom CSS?

Post by TBT »

Excellent, thank you.
Nagios XI 5.9.1 (8 Servers)
Nagios Fusion 2024R1.0.2
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Dashlet option for custom CSS?

Post by scottwilkerson »

TBT wrote:Excellent, thank you.
Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked