Author Topic: Droplet ShowSection with conditional parameter  (Read 2832 times)

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
Droplet ShowSection with conditional parameter
« 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.
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Droplet ShowSection with conditional parameter
« Reply #1 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
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
Re: Droplet ShowSection with conditional parameter
« Reply #2 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.
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Droplet ShowSection with conditional parameter
« Reply #3 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
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
Re: Droplet ShowSection with conditional parameter
« Reply #4 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.
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!