Author Topic: How to create a lib_jquery preset to droplets  (Read 4403 times)

Offline SnapDaddy

  • Posts: 44
How to create a lib_jquery preset to droplets
« on: August 28, 2012, 12:09:06 AM »
Hi All,

Is it possible to create a droplet to insert "[[LibInclude?lib=lib_jquery&preset=slimbox]]" or other presets from the insert droplet function in the wysiwyg editor.

Thanks  :-D
Remember, experience is what you get when you don’t get what you want…

Offline dbs

  • Betatester
  • **
  • Posts: 8008
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: How to create a lib_jquery preset to droplets
« Reply #1 on: August 28, 2012, 08:14:46 AM »
Hi, don't ask, simply try:

dropletname: slimbox
Code: [Select]
return '[[LibInclude?lib=lib_jquery&preset=slimbox]]';
 :wink:

Offline SnapDaddy

  • Posts: 44
Re: How to create a lib_jquery preset to droplets
« Reply #2 on: August 28, 2012, 10:26:29 PM »
Thanks dbs, tried that, but all I get when I insert is the droplet's name of [[Slimbox2]] and not the return of [[LibInclude?lib=lib_jquery&preset=slimbox]]  :?

Here's what I have:

Name: SLimbox2
Description: Inserts the Slimbox2 Preset
Code: return "[[LibInclude?lib=lib_jquery&preset=slimbox]]";
Comments: Use: [[LibInclude?lib=lib_jquery&preset=slimbox]]

I'm using WB 2.8.3 SP1 & Droplet v1.72
Remember, experience is what you get when you don’t get what you want…

Offline dbs

  • Betatester
  • **
  • Posts: 8008
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: How to create a lib_jquery preset to droplets
« Reply #3 on: August 28, 2012, 10:55:33 PM »
You have something like that in the head of the index.php of your template?
Code: [Select]
<?php
// automatically include optional WB module files (frontend.css, frontend.js)
if (function_exists('register_frontend_modfiles')) {
register_frontend_modfiles('css');
// register_frontend_modfiles('jquery');
register_frontend_modfiles('js');
} ?>

Offline SnapDaddy

  • Posts: 44
Re: How to create a lib_jquery preset to droplets
« Reply #4 on: August 28, 2012, 11:43:47 PM »
Yes. Here's what I have...

Code: [Select]
// this allows to include the optional module files (frontend.css, frontend.js) into the head section
if(function_exists('register_frontend_modfiles')) {
  register_frontend_modfiles('css');
  register_frontend_modfiles('js');
}
Remember, experience is what you get when you don’t get what you want…

Offline dbs

  • Betatester
  • **
  • Posts: 8008
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: How to create a lib_jquery preset to droplets
« Reply #5 on: August 29, 2012, 07:17:04 AM »
You can use other droplets on other pages?
Have you tried a standard-template like "round"?

Offline BlackBird

  • Posts: 2573
Re: How to create a lib_jquery preset to droplets
« Reply #6 on: August 29, 2012, 10:50:56 AM »
??? A droplet that returns droplet markup??? I don't think this can work...

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: How to create a lib_jquery preset to droplets
« Reply #7 on: August 29, 2012, 11:00:08 AM »
A droplet that returns droplet markup??? I don't think this can work...

In WB 2.8.3 it should work. By default "3 levels deep"

Offline dbs

  • Betatester
  • **
  • Posts: 8008
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: How to create a lib_jquery preset to droplets
« Reply #8 on: August 29, 2012, 11:11:46 AM »
yes it works, have tested.  :wink:

Offline BlackBird

  • Posts: 2573
Re: How to create a lib_jquery preset to droplets
« Reply #9 on: August 29, 2012, 11:12:28 AM »
Okay, but does it make sense? :?

Offline dbs

  • Betatester
  • **
  • Posts: 8008
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: How to create a lib_jquery preset to droplets
« Reply #10 on: August 29, 2012, 11:13:56 AM »
NO  :-D

For this is the page-based-function good, but i can't explain it in english.
The real droplet-call is tooooooo long.
« Last Edit: August 29, 2012, 11:16:52 AM by dbs »

Offline Ruud

  • Posts: 3649
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: How to create a lib_jquery preset to droplets
« Reply #11 on: August 29, 2012, 11:21:27 AM »
In the case of the topic starter I think it makes sense.

This way you can tell a client to include a certain droplet on a page without having to tell him/her about any difficult parameters.

Offline BlackBird

  • Posts: 2573
Re: How to create a lib_jquery preset to droplets
« Reply #12 on: August 29, 2012, 11:52:37 AM »
k, ic

Offline SnapDaddy

  • Posts: 44
Re: How to create a lib_jquery preset to droplets
« Reply #13 on: August 29, 2012, 05:20:32 PM »
Good feedback All!

To answer the question why create a droplet to insert a droplet, for me it is for jquery presets I create for client projects and ease of use.

The presets are droplets, but have no way to be inserted, you have to remember the droplet and prams and manually type it in (unless I'm missing something)...yet we have a complete droplet system to insert droplets, with comments as how to use them. So, my post was essentially a way to use the droplet system for jquery (or other) presets.

Since I'm on this topic, if the droplet function was modified to search for existing droplet presets and include them in the droplet dropdown when inserting, it would avoiding having to do what I am doing here!

Anyhow, thanks for the help! I got it working as dbs explained... :-D
Remember, experience is what you get when you don’t get what you want…

 

postern-length