Bugzilla – Bug 1235
addLinks() not working for plugins
Last modified: 2008-08-18 10:53:41 UTC
I wanted to add a plugin's web page to some other section of the SlimServer's web page. According the plugin documentation, this is easily possible: "Plugins also have the option of adding links to other sections of the SlimServer index page. [..] Links can be added using the Slim::Web::Pages::addLinks() method." This does not seem to work: when I call this method, all (most?) of the other links of the section will disappear.
please provide the lines of code that you are using. MusicMagic and Moodlogic both use this function successfully to add mixerlinks to browse pages.
the docs seem to mention using $client->string, which I believe is no longer the case. it should be the string token only.
These use the "mixer" section. I tested using the search and browse sections. This is a diff to the RadioIO plugin (2278) which adds a simple web page: Index: /home/mh/eclipse/SVN/Plugins/RadioIO.pm =================================================================== --- /home/mh/eclipse/SVN/Plugins/RadioIO.pm (revision 2786) +++ /home/mh/eclipse/SVN/Plugins/RadioIO.pm (working copy) @@ -155,11 +155,27 @@ return 'PLUGIN_RADIOIO_MODULE_NAME'; } +# Web pages + +sub webPages { + my %pages = ("index\.htm" => \&handleWebIndex); + Slim::Web::Pages::addLinks("browse", { 'PLUGIN_RADIOIO_MODULE_TITLE' => "plugins/RadioIO/index. html" }, 1); + return (\%pages, "index.html"); +} + +sub handleWebIndex { + my ($client, $params) = @_; + $params->{'station_names'} = \@station_names; + + return Slim::Web::HTTP::filltemplatefile('plugins/RadioIO/index.html', $params); +} + + sub strings { return " PLUGIN_RADIOIO_MODULE_NAME - DE radioio.com Internet Radio + DE radioio.com - no boundaries. EN radioio.com - no boundaries. ES radioio.com - sin límites.
moser fixed at r2796