What happens if you remove the parentheses and just have:
No idea if this is the problem but the parentheses didn’t exist in Random Mix code.Code:[% USE table excludedgenrelist, cols=3, pad=0 %]
If this isn’t the problem can you post the plugin code that fills excludedgenrelist, sounds like it isn’t an array based on the error message.
Results 11 to 20 of 24
Thread: html template documentation?
-
2021-03-02, 12:02 #11Erland Isaksson (My homepage)
Developer of many plugins/applets
Starting with LMS 8.0 I no longer support my plugins/applets (see here for more information )
-
2021-03-02, 12:12 #12Erland Isaksson (My homepage)
Developer of many plugins/applets
Starting with LMS 8.0 I no longer support my plugins/applets (see here for more information )
-
2021-03-02, 12:32 #13
- Join Date
- Jul 2010
- Posts
- 220
-
2021-03-03, 00:35 #14
html template documentation?
> Must have done it wrong, it always gave me "1" before. But now I've
> found a subroutine for that and the genre names are displayed as they
> should.
Yeah, I believe this bit me before: you don't assign the result of the
call to the variable, but the variable would be modified in place...
> BTW do you have any idea how I can *get rid of the html::template error
> message* mentioned in 'post 6'
> (https://forums.slimdevices.com/showt...#post1012366)?
> Or should I just ignore that?
I'm sorry, didn't have time to look into this so far. But when I skimmed
the code I thought you were trying to iterate over an object or
something. But don't ignore it.
-
2021-03-03, 06:38 #15
- Join Date
- Jul 2010
- Posts
- 220
I've changed the handler a little and tried to base this as much as possible on how the randomplay plugin does it (here and here). At first I thought something was wrong with the list the table plugin receives (as the error message would suggest).
Both my plugin and randomplay store a simple (sorted) array with just genrenames in the params for the table declaration and use the hash of hashes with all the relevant information later for each item. Seems the same to me.
But while randomplay throws no such error my plugin keeps on doing it.
There must be something (small?) I'm missing. Right now I'm all out of ideas on how to get rid of this error.
-
2021-03-03, 07:07 #16
html template documentation?
> There must be something (small?) I'm missing. Right now I'm all out of
> ideas on how to get rid of this error.
You can dump the content of a variable in the template:
[% USE Dumper; Dumper.dump(genrelistsorted) %]
Then look a the rendered page's code in the browser's dev tools
Oh, and run LMS with --nobrowsecache - otherwise the rendered page could
be cached with its error, repeatedly returning the incorrectly rendered
page. Or restart LMS between edits of the HTML template.
-
2021-03-03, 07:36 #17
- Join Date
- Jul 2010
- Posts
- 220
Finally! I've figured it out.
I've moved the code that feeds the params to the settings page into the beforeRender function and no more error.
Thank you all for your help.
-
2021-03-09, 08:30 #18
- Join Date
- Jul 2010
- Posts
- 220
One more thing:
if you have a html input element with selectfile, a file picker, is it possible to open the file picker at a certain folder?
It always starts at the root level and I'd like to skip the clicking down the file tree and have it start in the playlistdir folder right away. Is that possible?
-
2021-03-09, 09:03 #19
html template documentation?
> if you have a html input element with -selectfile-, a file picker, is it
> possible to open the file picker at a certain folder?
It should automatically open at the folder defined in the corresponding
input field. Would you have some code?
-
2021-03-09, 09:37 #20
- Join Date
- Jul 2010
- Posts
- 220
Code:<input type="text" class="stdedit selectFile_xml" name="pref_restorefile" id="restorefile" value="[% prefs.restorefile %]" size="40">
BTW I use selectFile_xml. Why does it allow me to choose a folder?