WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: bupaje on April 16, 2013, 08:33:37 PM

Title: Call Droplet in Code2: PHP module?
Post by: bupaje on April 16, 2013, 08:33:37 PM
I have a Code2 module on my main page that has some PHP and escaped HTML code, I want to call a WYSIWYG area so I can easily update some and the following droplet looks perfect

Use [[ShowSection?section=1081]]

but my efforts don't work so not sure if it can be done?

Thanks.

Title: Re: Call Droplet in Code2: PHP module?
Post by: Ruud on April 16, 2013, 10:00:15 PM
If you are in the php world you should use: echo '[[ShowSection?section=1081]]';

If that is not solving the problem tell us some more on "my efforts don't work".
Otherwise it is very hard to tell what is wrong.
Title: Re: Call Droplet in Code2: PHP module?
Post by: bupaje on April 17, 2013, 02:18:26 AM
Thanks for the reply. If I use the echo statement as in your example it shows it as written [[ShowSection?section=1081]] on the page - it doesn't run the php.
Title: Re: Call Droplet in Code2: PHP module?
Post by: Ruud on April 17, 2013, 10:27:45 AM
it doesn't run the php.
So what does it do?

Do you see the droplet call in your output?
Do you get an error (set errorreporting to E_ALL)?
Do you see nothing?
Does it work when you add the droplet in a WYSIWYG page?

Title: Re: Call Droplet in Code2: PHP module?
Post by: bupaje on April 17, 2013, 10:04:58 PM
Settings error code to all does not show any errors. I simply see the unrendered code on my site.

Use [[ShowSection?section=1081]]

 you can see it on this page http://stormvisions.com/ if it is still not clear. In WYSIWYG or Code2 module - no difference.

I verified that a different droplet does work so something specific to this module.
Title: Re: Call Droplet in Code2: PHP module?
Post by: Ruud on April 17, 2013, 10:16:56 PM
This typically has 3 possible causes..

1. Droplets are either not installed, or uninstalled.
2. The droplet "ShowSection" does not exist in your website.
3. Some other PHP error (failure) stops php before droplets are executed.

the first one is unlikely..
the second can only be checked by yourself..
the third on can be checked by calling [[lorem]] or any other standard droplet. If this fails too, do the same checks on a different page.
Title: Re: Call Droplet in Code2: PHP module?
Post by: bupaje on April 17, 2013, 10:39:31 PM
Weird [[Lorem]] and all others seem to work but not that one. It is installed and enabled. I copied a fresh version of the code and still no good. I'll see if sectionpicker or some other droplet or code will do what I need.

Do the droplets get stored in a particular folder or are they only in the database? I wanted to verify the actual file and permissions but long shot.
Title: Re: Call Droplet in Code2: PHP module?
Post by: Ruud on April 17, 2013, 10:46:08 PM
Weird [[Lorem]] and all others seem to work but not that one.
Double check the name of your showsection droplet. If there is a typo (check for blanks too) in the name this will be the result. (naming is case insensitive)
If the droplet exists, it will generate something (error/content/blank) and the [[...]] will be replaced.

Droplets are stored in the database, so no permission problems should occur.

Title: Re: Call Droplet in Code2: PHP module?
Post by: bupaje on April 17, 2013, 10:47:27 PM
More strangeness. I tried sectionpicker and saw that it did get the word 'Test' from the wysiwyg but showed it 5 times. Then I tried again and it printed the word Use  and a balnk space 5 times and then the droplet call as plain text [[sectionpicker whatever]] then accidentally put it twice on the page and I got

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 79703315 bytes) in /home/storm59/public_html/modules/droplets/droplets.php on line 106

anyway here is the output I get from section picker

http://www.stormvisions.com/pages/home/latest-downloads.php
Title: Re: Call Droplet in Code2: PHP module?
Post by: Ruud on April 17, 2013, 11:13:51 PM
This looks like a sectionpicker calling another sectionpicker calling te first sectionpicker.. in the end it will crash somewhere..

Title: Re: Call Droplet in Code2: PHP module?
Post by: bupaje on April 17, 2013, 11:37:46 PM
I assume this must be a problem with the php setup on my host? Hmmm... I also use Incapsula to protect the website, not sure why that would affect it but anyway I know I can't do it. I'll see if I get an answer on the RSS thing (generate rss feed of last 5 Downloads Gallery and Bookmarks module as I use RSS on several places and that is simple and works well. Thank you for taking the time to answer.