Integrate CloudSponge in Drupal.org
In the follow steps, we'll reproduce the instructions in a new Drupal instance to embed the CloudSponge widget.
1. Check your Default Theme
After login into your Drupal instance, click on
Appearance in the top menu. A dialog will be displayed, and the used theme will be displayed as
We'll use, as example, the
Bartik theme as our default theme.
2. Open the template.php to edit
Now we know the used theme, let's localize the
template.php file for this theme.
At the Drupal installation folder, there is a
/theme folder, with all installed themes. As we're using
Bartik as theme, our template file is located at
Remember if you're using a different theme than
Bartik, just replace the folder name with your theme name.
Open this file (
template.php) in a text editor.
3. Add CloudSponge calls to theme
At the beginning of the
template.php file, right after the
<?php directive, add the following lines, replacing
YOUR_DOMAIN_KEY by your CloudSponge account key:
drupal_add_js('//api.cloudsponge.com/widget/YOUR_WIDGET_KEY.js', array('type' => 'external', 'scope' => 'footer'));
Save and close
4. Create a Page to import contacts
Now you have CloudSponge properly configured for your theme, let's create a page to import contacts using the CloudSponge widget.
After login in your Drupal instance, click on
Add new content.
Add contentdialog, select
Basic Page. The
Create Basic pageeditor will be loaded.
Create Basic pageeditor, change the
Text Format: select
For title, fill it with
Bodywith the following code:
<a class="cloudsponge-launch">Add From Address Book</a> <!-- This textarea will be populated with the contacts returned by CloudSponge --> <textarea class="cloudsponge-contacts" style="width:450px;height:82px"></textarea>
Mark as checked the
Provide a menu linkoption.
5. Import your Contacts
After save your CloudSponge page, you'll see this entry as a tab in your Drupal site. Click on it.
The CloudSponge page will be displayed with a link (
Add from Address Book) and a textarea to receive all imported contacts.
Add from Address Book and check if you can import your contacts.
6. Customize it
Now you can import your contacts, customize this Basic Page content, title and body on Drupal to match your needs.