But when I put in it an echo it gives the page name and not the droplet name.
True, surely it will give the pagename
The order of how things work in WB are essential to get this
first the whole output is generated, then the droplets are executed
$pagetitle = "[[pagetitle]]";
$page = "Drumles";
$welkom = "Welkom";
if($pagetitle == $page) {
Here during output building the $pagetitle stays at [[pagetitle]] so the if will say not equal
Then during droplet execution the [[pagetitle]] will be changed, but the if will not be done again!
Or you need to combine things in one droplet or in this case:
$pagetitle = PAGE_TITLE;
$page = "Drumles";
$welkom = "Welkom";
if($pagetitle == $page) {
echo "[[Dewplayer?song=1.mp3&autostart=0]]";
}
else {
echo"[[Dewplayer?song=2.mp3&autostart=0]]";
}
Will work as well
There is in this case no need for the droplet pagetitle
Have fun,
John