Support and General Use > Theming and Appearance Customization

Conditional WPS backgrounds via %?if

(1/2) > >>

Progweed:
I'm reworking one of my themes and I'd like to display different background images depending on the presence of album art. I want to do this with the new logical comparison tag.

Viewports are defined the usual way:

--- Code: ---%?C<%Vd(a)|%Vd(b)>
--- End code ---

Now I want to do something like this:

--- Code: ---%?if(, , )<%X(background.bmp)|%X(background_noart.bmp)>
--- End code ---

What tag, operator and operand is required to determine whether an album cover is present or not? Or to put it another way: Is there a way to determine which viewport I'm in?

JdGordon:
you cannot do conditional background images at all (well not currently).

%if() is only needed when the normal conditionals arnt good enough for your needs. %?C<yes aa| no aa> will work just as welll

Progweed:

--- Quote ---you cannot do conditional background images at all (well not currently).
--- End quote ---
That's a pity…  :(


--- Quote ---%if() is only needed when the normal conditionals arnt good enough for your needs. %?C<yes aa| no aa> will work just as welll
--- End quote ---
Yes, I thought so too, but %?C<%X(art.bmp)|%X(noart.bmp)> doesn't work as intended. This code *always* displays the 2nd (no art) image. Is this a bug then?

JdGordon:
you cant put %X inside conditionals... you can only put one %X *anywhere* in the skin... after parseing that would actually become %?C<|> because %X is stripped out before it is displayed (You can check this by putting hello inside the yes branch)

Progweed:
Oh, okay then. Is there any other way to put a graphical element behind a progress bar without embedding it in the background image?

Navigation

[0] Message Index

[#] Next page

Go to full version