WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Trying to create simple droplet
  • Print
Pages: [1]   Go Down

Author Topic: Trying to create simple droplet  (Read 6459 times)

Argos

  • Guest
Trying to create simple droplet
« on: October 29, 2010, 04:25:18 PM »
I am trying to create a simple droplet, but being a non-coder this is even too difficult for me. Maybe someone can help me out. Must be very simple for coders  :roll:

I want this output:
Code: [Select]
<span class="wooo" price="true" text="In winkelwagen »">X</span>where X is the ID I want to set.

So for example I want to create:
Code: [Select]
<span class="wooo" price="true" text="In winkelwagen »">15</span>with a droplet like [[shop?id=15]]

After looking at other droplets I came up with this code, but it doesn't work:
Code: [Select]
$id = 'id=';
$retval .= '<span class="wooo" price="true" text="In winkelwagen »">';
$retval .= '$id';
$retval .= '</span>';
return $retval;

It works partially, because it returns:
Code: [Select]
<span class="wooo" price="true" text="In winkelwagen »">$id</span>
But I cannot figure out the id part... Please help me out! Thanks.
« Last Edit: October 29, 2010, 04:32:06 PM by Argos »
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Trying to create simple droplet
« Reply #1 on: October 29, 2010, 04:32:08 PM »
Hello Jurgen,
it seemsto me that you're almost done.

Change some lines only:
Code: [Select]
<?php //colorize the code, ignore this line

$id = (isset($id)) ? $id : &#39;you forgot the ?id parameter&#39;;
$retval .= &#39;<span class="wooo" price="true" text="In winkelwagen &raquo;">&#39;;
$retval .= $id; //remove the &#39;&#39; <- quotes from the variable, otherwise it will be put out asplaintext
$retval .= &#39;</span>&#39;;
return $retval;

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Argos

  • Guest
Re: Trying to create simple droplet
« Reply #2 on: October 29, 2010, 04:35:51 PM »
YES, that works beautifully! Very nice, thank you stefek, I really appreciate your quick help  :-D
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Trying to create simple droplet
« Reply #3 on: October 29, 2010, 04:40:02 PM »
You're welcome.

The one thing was, you overwrote the variable delivered via [[droplet-macro]]
And the other thing: the single quotes around the variable.

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Argos

  • Guest
Re: Trying to create simple droplet
« Reply #4 on: November 03, 2010, 01:19:03 AM »
Thanks for the explanation!

By the way: I needed this droplet to use with a smooth little webshop script: http://codecanyon.net/item/woooshop-shopping-cart-for-every-website/108838

Mind you, it's a very basic shopping cart script, and the admin is not integrated into WB. But it's smooth jQuery and easy to use for clients that don't need a full featured webshop. The droplet can be used for clients to simply add Buy Now buttons to items on regular WB WYSIWYG pages. They only need the item ID from the shop script admin, and put that in the droplet.
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Trying to create simple droplet
« Reply #5 on: November 03, 2010, 01:53:25 AM »
Looks good, Jurgen.

Good luck with your project.

If you need help on droplets again, just ask. ;-)

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Trying to create simple droplet
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2