Drupal is one of the most popular content management systems along with Wordpress and Joomla.
Download the zip file attached at the bottom of this page.
Unzip the zip file into the modules directory of your drupal installation.
Go to the Administer->Modules Page of your drupal Site. You will see a module named Daylife. Click on the Enabled Checkbox and Save the settings. Your Daylife module is installed.
Go to the Administer Section (/admin) of your drupal site. Under Content Management (/admin/content) you will see a section named 'daylife' (/admin/content/daylife).
Go to the daylife admin page (/admin/content/daylife) and it will ask you for an Accesskey and a Shared Secret. You will need to signup on http://developer.daylife.com to receive an email with these API credentials.
Once you have configured the API credentials, your module is ready to make the DayPI calls.
You can use the Drupal Permissions system to configure which kind of users can see the Daylife powered content on your site. You can enable that by going to the Administer By module (/admin/by-module) page and going to the Configure Permissions page (/admin/user/access#module-daylife) for the Daylife module.
You will have 2 types of permissions:
The users that have the 'access daylife api' permission can see the daylife content on the pages.
The users that have the 'administer daylife api' permission can configure the daylife api settings as described in the Configure section above.
Now you are ready to create your first block.
Go to Administer -> Blocks (/admin/build/block) and click on Add Block (/admin/build/block/add) tab on the top of the page.
Fill out the title you want for the block in the Block Description input box. For e.g., if you want to put news about iphone, type in iphone in the block description.
Put in the following code in the Body box and save your block.
$block = daylife_block('view',0, "iphone");
$content = $block['content'];
echo $content;
Once you have saved your block, you need to enable it and configure where you want it to show up on the site. Go back to the Administer blocks page (/admin/build/block) and select the region and weight for your block to configure it position on the site.
And you should now have a block with the news content from daylife about iphone
| Attachment | Size |
|---|---|
| daylife_drupal_module.zip | 4.86 KB |