WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: Argos on March 26, 2009, 03:47:22 PM

Title: Droplet ShowSection with conditional parameter
Post by: Argos on March 26, 2009, 03:47:22 PM
I use the droplet ShowSection with an added condition. It only shows on certain pages. It looks like this:

Code: [Select]
$ids2 = array(0,1,34,36,38); // show droplet only on pages with these ID's
if (in_array($page_id,$ids2))
{
echo("[[showsection?section=56]]"); // this is the section to show
}

I am no coder, and I have done this by trial and error (took me two hours of searching and trying, don't laugh...). But it works, so I'm very proud of myself LOL  :-D

I was wondering if someone with coding skills could take this idea and rework the conditon into some parameter for the droplet, or droplets in general, or some other neat idea to easily add conditions to showing stuff.
Title: Re: Droplet ShowSection with conditional parameter
Post by: pcwacht on March 26, 2009, 04:26:55 PM
Quote
took me two hours of searching and trying, don't laugh
Not laughing, am proud of you too!

Trial and error is the best way to start coding, and coding becomes sheer fun!!

John
Title: Re: Droplet ShowSection with conditional parameter
Post by: Argos on March 26, 2009, 06:49:11 PM
I found out that droplets don't work on pages with form-sections. How come? Both Form and FormX mess it up. Instead of the output of the droplet, the droplet tag is shown.
Title: Re: Droplet ShowSection with conditional parameter
Post by: pcwacht on March 26, 2009, 08:56:05 PM
At Argos,
Look here -> https://forum.WebsiteBaker.org/index.php/topic,13325.0.html

The form flushes the output cach,
seem remarking that bit out does the trick.

You can try and give feed back in that thread so Ruud and I will know what works and what not.

John
Title: Re: Droplet ShowSection with conditional parameter
Post by: Argos on March 27, 2009, 01:01:35 AM
At Argos,
Look here -> https://forum.WebsiteBaker.org/index.php/topic,13325.0.html

The form flushes the output cach,
seem remarking that bit out does the trick.

You can try and give feed back in that thread so Ruud and I will know what works and what not.

John

Thanks John. I chose to disable the filter options in the backend, that solved the problem.