Difference between revisions of "FPP:Plugins"

From wiki
Jump to: navigation, search
Line 32: Line 32:
 
* '''plugin''' - This is the directory name of your plugin.  It will be the same as the name of your git repository.
 
* '''plugin''' - This is the directory name of your plugin.  It will be the same as the name of your git repository.
 
* '''page''' - The name of the page within your plugin directory to be included.
 
* '''page''' - The name of the page within your plugin directory to be included.
 +
 +
'''Example'''
 +
 +
Here's a quick example of a demo_page.php:
 +
<pre>
 +
<h1><?php echo "Hello World"; ?></h1>
 +
<p>
 +
This is a demo plugin page.
 +
</p>
 +
</pre>
  
 
==FPP Daemon==
 
==FPP Daemon==

Revision as of 18:31, 27 June 2014

FPP UI

Adding FPP Menu Entries

We allow menu entries into each of the top-level menus. These are drawn in the UI menus if your plugin incorporates a specially named file for each menu entry. To include something in the "Status/Control" menu, you must include a file named "status_menu.inc". The contents of this file should be a list element and link with text. The menu styling will happen automatically as it will be included within the proper menu's unordered list.

Status/Control Content Setup Output Setup Help
status_menu.inc content_menu.inc output_menu.inc help_menu.inc

Example

Prerequisites:

  • You're writing a plugin called "RDS Plugin"
  • Your plugin's repository name is "rds_plugin" (passed to plugin.php's "plugin" parameter)
  • You want a menu entry titled "RDS Setup" under "Output Setup" that will link to your plugin's "rds_setup.php" page for configuration

Your output_menu.inc:

<li><a href="plugin.php?plugin=rds_plugin&page=rds_setup.php">RDS Setup</a></li>

Of course, you must have a file named "rds_setup.php" in your plugin as well, so that when you click the menu entry, your page is drawn.

Adding FPP Plugin Pages

You can write pages that will be drawn using plugin.php. The main page takes care of the main UI details such as the menu entries, session support, header, footer, etc. Your page will only need to include the content within the "bodyWrapper" div of the main FPP UI layout.

To access your page you must use plugin.php and include at least two GET variables.

  • plugin - This is the directory name of your plugin. It will be the same as the name of your git repository.
  • page - The name of the page within your plugin directory to be included.

Example

Here's a quick example of a demo_page.php:

<h1><?php echo "Hello World"; ?></h1>
<p>
This is a demo plugin page.
</p>

FPP Daemon

The daemon supports callbacks during execution. These are useful to get data from the daemon without having to query the FPPD socket or running your own daemon to parse certain details.

Plugin Types

Media

Playlist

Next Playlist Entry

Plugin Requirements and Installation