Current Page Drople combined with if statement issue

pcwacht

QuoteBut 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
[url="http://www.ictwacht.nl"]http://www.ictwacht.nl[/url] = Dutch ICT info
[url="http://www.pcwacht.nl"]http://www.pcwacht.nl[/url] = My first
both still work in progress, since years.....

denkel

Hi,

Okay.

But when I put in it an echo it gives the page name and not the droplet name.
I'm a beginner at making droplets, how am I going to import this in a droplet?

This is my MP3 droplet:
$returnvalue .= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="160" height="20" id="Hörbeispiel" align="middle">';
$returnvalue .= '<param name="wmode" value="transparent" />';
$returnvalue .= '<param name="allowScriptAccess" value="sameDomain" />';
$returnvalue .= '<param name="movie" value="'.WB_URL.'/dewplayer-mini.swf?mp3='.WB_URL.'/media/'.$song.'&autostart='.$autostart.'" />';
$returnvalue .= '<param name="quality" value="high" />';
$returnvalue .= '<param name="bgcolor" value="FFFFFF" />';
$returnvalue .= '<embed src="'.WB_URL.'/dewplayer-mini.swf?mp3='.WB_URL.'/media/'.$song.'&autostart='.$autostart.'" quality="high" bgcolor="FFFFFF" width="170" height="20" name="Hörbeispiel" wmode="transparent" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
return $returnvalue;


This is my pagetitle droplet:
return PAGE_TITLE;


regards,

Dennis

pcwacht

Yups, I can.

First, please do post questions once! Either NL or UK.
Start with one language and when a answer is not given, then try the other languages.

The page is made BEFORE the droplets are executed, so the if statement get the [[...]] and not the output of the droplet.

Get everything in a droplet and it will be fine.

John
[url="http://www.ictwacht.nl"]http://www.ictwacht.nl[/url] = Dutch ICT info
[url="http://www.pcwacht.nl"]http://www.pcwacht.nl[/url] = My first
both still work in progress, since years.....

denkel

Hello,

I'm quite new to Website Baker CMS. I made my own template and i'm trying to set a different song for specific pages. I imported an MP3 module which works.
I also made a droplet to recognise which page is open, it looks like this:
return PAGE_TITLE;
You can call it with [[pagetitle]]

Now i'm making an if statement in the footer of my website so i can set a different song at specific pages.
My if statement looks like this:
            <?php
$pagetitle "[[pagetitle]]";
$page "Drumles";
$welkom "Welkom";
if($pagetitle == $page) {
        
echo "[[Dewplayer?song=1.mp3&autostart=0]]";
}
else {
echo"[[Dewplayer?song=2.mp3&autostart=0]]";
}
?>


The problem is that he doesn't play the 1.mp3 if the page is set at "Drumles", it goes straight to the else.
I tested the [[pagetitle]] droplet which works at any page..

Someone can tell me what i'm doing wrong?

I'm sorry for my english skills ^^

Kind regards,

Dennis