Support and General Use > Theming and Appearance Customization

no nesting after all?

(1/1)

NaFIann:
Hi,

I'm currently modifying an existing theme for my own use (the font was too small for me:p).
In doing so, I wanted it to display genre for 5 secs and then year for 5 secs, if either wasn't available I wanted to continuously display just one and if none was available just display nothing.
the code I came up with was this:

%?ig< %?iy< %t5%ig;%t5%iy | %ig> | %?iy< %iy > >

which to me seems fine, since the manual said nesting was okay. However, using this messes the entire theme up. So, is it just not possible? (in my opinion this can be parsed only one way and should thus give no problem, but hey, wo am I?)
Any help would be nice.

NaFiann

Lear:
I'm pretty sure you need to do it the other way around. I.e., you can't put alternating lines inside a conditional, it must be outside. It should be possible to do what you want that way, but it would be a little ugly, I think (lots of repeating conditionals).

pixelma:
Nesting in general is possible but in this case I believe you can't put the next subline define in the conditional the way you do (as Lear said). I've seen some code that works with defining the time the subline is displayed as zero in a conditional - meaning "%t5" if the tag is present and "%t0" if not, but the subline divider ";" would still be outside the conditional. Somehow I couldn't get this to work as expected for me so I came up with something else in a similar situation. With your genre and year tags it would look as follows (didn't test though):

--- Code: ---%t5%?ig< %ig|%iy>;%t5%?iy< %iy|%ig>
--- End code ---
which would display the one available just a second time. You won't notice at all unless the line has to scroll. In my experience even if it has to scroll, the "restart" of the same line is almost not noticeable with a time of 5 or 6 seconds for the subline.

Also if you would like to have control over what is displayed if none of the two is available you can nest ;) like this for example:

--- Code: ---%t5%?ig< %ig|%?iy< %iy|no year>>;%t5%?iy< %iy|%?ig< %ig|no genre>>
--- End code ---
P.S. Maybe someone else can provide you with a working example of the first way I mentioned.

Mikerman:
I've done it the other way around and it works; it just can be (as noted) a bit "long" that way.  But hey, it's all a New York Times crossword puzzle, in the end.

;)

Navigation

[0] Message Index

Go to full version