[SOLVED] Perform action IF parent album's name is XY
andreste
Joined: 2006-06-02
Posts: 123 |
![]() |
Hi, this is what I'd like to do and I found no threads about it: would it be possible to have a code that says "if the parent album is called XY, then do this"... Something like this |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
Dave ____________________________________________________ |
|
andreste
Joined: 2006-06-02
Posts: 123 |
![]() |
Hello, after 4 years I'm back on this matter (I abandoned that idea then, but now I need it again and I still don't know how). So, should it be something like this? Quote:
{if $theme.parent.title|markup == 'Male'} blabla1 |
|
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
Should, but I have not tested. Dave |
|
andreste
Joined: 2006-06-02
Posts: 123 |
![]() |
Now it works, I had forgotten the space in "else if". {if $theme.parent.title|markup == 'Male'} Male {else if $theme.parent.title|markup == 'Female'} Female {/if} |
|
andreste
Joined: 2006-06-02
Posts: 123 |
![]() |
Excuse my ignorance, but how do I instruct it to do something else if the title is neither Male nor Female? For example the root album (and others) shouldn't do anything, but how do I tell Gallery so? I tried some combinations of IF and ELSE IF and ELSE, but they were really shots in the dark. thanks |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
{if $theme.parent.title|markup == 'Male'} Male {else if $theme.parent.title|markup == 'Female'} Female {else}do something else {/if}
-s |
|
andreste
Joined: 2006-06-02
Posts: 123 |
![]() |
Thank you, that's what I thought and tried, but it doesn't work. This is what I have: {if $theme.parent.title|markup == 'Male'} javascript-1 {else if $theme.parent.title|markup == 'Female'} javascript-2 {else} zzz {/if} but with the final {else} it doesn't work, the page stops loading there. If i remove it, it works (but I get javascript-2 on the root album and other ones). |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
andreste
Joined: 2006-06-02
Posts: 123 |
![]() |
thanks Suprsidr, I got it! On the contraty, if I don't use the final {else}, I must write {else if} (or I get nothing!) thanks a lot |
|