Problem with droplet and echo

cliff

I have solved that Problem with your helf ... thanx

but I had to Change the code:
$sUrl = getenv("SERVER_NAME")."".$_SERVER["PHP_SELF"];
return '<div class="fb-comments" data-href="'.$sUrl.'" data-numposts="5" data-colorscheme="light"></div></div>';


cliff


cliff

That is working, but the PAGE_TITLE command does not Show the dash between words, when the page title got more than one word  :-(

Stefek

Hello Cliff,

try this one:


<?php

// droplet code
$sUrl WB_URL.'/'.PAGES_DIRECTORY.'/'.PAGE_TITLE.'.'.PAGE_EXTENSION;
return 
'<div id="comment"><div class="fb-comments" data-href="'.$sUrl.'" data-numposts="5" data-colorscheme="light"></div></div>';


Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

DarkViper

By design Droplets does not produce direct output.
A Droplet simply creates a string value which is used then for Search/Replace operations in frontend-output-filter.
[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

cliff

I Forget this one I tested also...

echo "<div id='comment'><div class='fb-comments' data-href='";
echo WB_URL;
echo "/pages/";
echo PAGE_TITLE;
echo PAGE_EXTENSION;
echo "' data-numposts='5' data-colorscheme='light'></div></div>";

cliff

Hey Stefek,

thanX!

I want to make a droplet for Facebook comments and tested this:

echo "<div id='comment'><div class='fb-comments' data-href='";
return getenv("SERVER_NAME")."".$_SERVER["PHP_SELF"];
echo "' data-numposts='5' data-colorscheme='light'></div></div>";

If I use only the return command, the correct URL will displayed, but with the echo commands it's broken...


Stefek

The use of echo in droplet code is not possible.
Use return instead.

Please post your droplet php code so we can have a look if you need more help.

Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

cliff

Hello,

I got a Problem with the php command "echo" in a droplet...

At the Frontpage the content of the echo command will be posed over the <html> in the sourcecode... What's going wrong?

Google and forumsearch doesn't help  :-(

Hopefully you understand my worse english  :mrgreen:

GreetZ
Cliff