6 Special Howtos for Drupal


Published on

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

6 Special Howtos for Drupal

  1. 1. Extending functionalityin drupal<br />Wilson Wingston Sharon<br />wingston.sharon@gmail.com<br />
  2. 2. What else you’ve got?<br />Custom front pages.<br />CAPTCHA support.<br />Galleries of content.<br />Javascript with jqueries.<br />More display control with panels.<br />More useful modules<br />
  3. 3. Front_page module<br />Allows you to specify a custom front page based on role type.e.g. <br />For a musicians website, you could have a different front page for Drummers, Guitarists, Singers, Bass Players etc.<br />Allows you to have a FULL front page or FLASH SPLASH page – in a completely different layout from your main drupal site<br />
  4. 4. CAPTCHA by mollom<br />Spam control<br />Install the mollom module and enable it.<br />Go to mollom.com and register your site.<br />Get the public and private keys after registration.<br />Enter these keys in administer>>site cofig>> mollom<br />
  5. 5. Mollom.com<br />Now set the fields that you want mollom spam control to enable.<br />Remember this adds a small overhead wherever you use it.<br />Use it only for user registration and user password request forms.<br />
  6. 6. Image galleries<br />Best option is to create a custom image type using CCK with an imagefield module [drupalmodules.org]<br />Use taxonomy to tag and organise your images.<br />Use views to display the images. <br />
  7. 7. Image galleries – more info<br />Use these modules.<br />CCK + imagefield<br />Image cache<br />Views + views bonus pack<br />Custom Pagers <br />allows administrators to define context-sensitive previous/next pagers for any node type.<br />Lightbox or thickbox<br />
  8. 8. Image gallery – howto 1<br />After installing modules<br />Go to image cache admin pages and create image presets.<br /><ul><li>'Square Thumbnail' – scale to 150 x 150 then crop to 75 x 75
  9. 9. 'Display' – scale to 650 x 650</li></ul>Go to administer content types and create a content type for images. Add an image field type to it.<br />Go to taxonomy and create a vocabulary and taxonomy to sort your images. Make it required to choose at least one term for your image content type.<br />
  10. 10. Image gallery – howto 2<br />Go to views and admin>>build>>views<br />In page settings choose bonus – grid view<br />In fields section add the title and image fields of your image content type.<br />On the image field<br />choose 'Do not group multiple values' for 'Handler‘ <br />chose the Imagecache preset size that you want to use for your gallery images in the 'Option' section.<br /> If you installed the Thickbox module, you should see an option called 'Thickbox: Square_Thumbnail<br />
  11. 11. Image gallery – howto 3<br />In the Filters section choose <br />Node Published = Yes<br />You can also filter by taxonomy here to show images with a particular term. If you wish.<br />Choose taxonomy term and give required settings.<br />you can create one gallery view and 'expose' the taxonomy filter [button on side] so people can choose what gallery to look at. <br />Check use AJAX in basic settings for changes w/o page reload.<br />
  12. 12. Image gallery – final tweaks<br />So at this point, if you have created some CCK image nodes, you should see a gallery at the page you’ve created. Give it a name and a menu block and check it out. Remember to save first though.<br />Go into administer>>'Custom pagers'<br /> Click 'Add a new custom pager'. Most of the settings will be obvious, but these are two key ones:<br />Node Type = Image (or again whatever you called you CCK image content type)<br />In the "Use a view" section, pick the name of your gallery view.<br />
  13. 13. SWF tools<br />SWF Tools allows you to easily embed flash content on your pages. <br />use CCK filefields.<br />or use an input filter with [swf file="mymovie.swf"]<br />or use PHP and call print swf('mymovie.swf');<br />[swf file="myAudio.mp3"] or [swf file="myVideo.flv"]. Will create a video player automatically.. <br />Remember to go to admnister>>input formats and enable swftools there.<br />
  14. 14. Jquery<br />In versions prior to Drupal 5.0, javascript effects are made possible through a decent library of functions in /misc/drupal.js. <br />One limitation of drupal.js was the fact that its development would never match the pace of dedicated javascript libraries.<br />The AJAX developers group began looking for agreement about which library should be used. <br />jQuery was identified as the best candidate. Its also under GPL and bundeled with drupal.<br />
  15. 15. Benefits of jquery<br />The core jQuery library is very small (about 15kb).<br />jQuery has a clean, modular approach to plugins.<br />The core library is stable, being in perpetual feature freeze from version 1.0.<br />
  16. 16. Jquery – javascriptteqniques<br /><?php<br />drupal_add_js (<br /> '$(document).ready(function(){$("p.jtest").fadeIn(6000);}); ',<br /> 'inline');<br />?><br /><p class="jtest" style=“width: 30em;display:none;"><br />This is an example of an effect which is built into the core jQuery<br />library. This text should fade in after the DOM is loaded. <a<br />href="http://api.drupal.org/api/HEAD/function/drupal_add_js"><br />drupal_add_js()</a> was used to add the <a href="http://jquery.com/api/"> fadeIn</a> effect to any paragraph with the class <b>jtest</b>.<br /></p><br />Add this content to a page with the php input filter turned on.<br />
  17. 17. Panels<br />The Panels module allows a site administrator to create customized layouts for multiple uses. <br />it is a drag and drop content manager that lets you visually design a layout and place content within that layout.<br />Integration with other systems allows you to customize the layout of your site with very fine grained permissions<br />
  18. 18. Panels && more views<br />Install the panels and the ctools module.<br />Go to administer>>views. Under default view list, find front page and archive views and click on enable for both of them. <br />Go to administer>>panels. Then to settings/panel pages..<br />Check everything in new content behaviour.<br />
  19. 19. Panels - 1<br />Go to dashboard in administer>>panels.<br />Create new panel page.<br />Admin title – Home<br />Path to front<br />Check make home page.<br />Click continue.<br />Choose flexible layout.<br />
  20. 20. Panels 2 – the design<br />Click show layout designer.<br />Click on the lowermost region, change name from center to “Left”.<br />Now, click on rows, just above it and select add region to right. Name it “Right”.<br />Move the slider bar to give a 80/20 shift.<br />Click finish.<br />
  21. 21. Panels 3 – …<br />Click on the menu tab on the left.<br /><ul><li>Normal menu tab.</li></ul>Set the Weight to: -10 <br />Title to 'Home'. <br />Click update and save.<br />
  22. 22. Panels 3 – adding content<br />Now go to the content tab.<br />Click on gear icon in left pane and choose add content.<br />Choose views, frontpage [created earlier] and choose page.<br />Check 'Link title to view'.<br />Check 'Provide a "more" link that links to the view'. Click 'Finish' at the bottom.<br />Update and save.<br />
  23. 23. Panels 4 – more and more<br />On the right pane, click gear icon<br />under activity select who’s new.<br />Click on gear again and select who’s online under activity.<br />Click on gear again and select archives under views. Use block display.<br />Link title to view and click finish.<br />Click finish and save.<br />Check your front page out.<br />Disable all blocks on frontpage.<br />
  24. 24. Robots.txt<br />Check robots.txt in your drupal root.<br />When using pathatuo, add following line<br />Disallow: /node/<br />Else, search engines will discover duplicate over a period of time, and some users have reported a penalization for duplicate content. However, Google states that there is no penalty.<br />
  25. 25. Gmap location module<br />Using a google maps module to acces the gmaps API.<br />Get the free google maps api key. [google it]<br />Creates a single Google Maps page (at http://yoursite.com/gmaplocation), designed to display one location for the site, with an address marker.* The map location is automatically geocoded from a street address.<br />
  26. 26. Community – social networking<br />Organic groups module allows you to create “groups” and assign users to choose a particular group.<br />users post content with visibility restricted to their group, a kind of private group chat or discussion.<br /> A group has its own administrator & users can subscribe to a group or be invited to join group. <br />OG module has many ancilliary modules that will allow multiple abilities on your website.<br />
  27. 27. Other modules for Social n/w<br />Blocks for OG<br />Private Forums for OG<br />Activity<br />Buddy list – lets your users have friends..<br />Friend module<br />User invite<br />User relationships<br />
  28. 28. Facebook connect (!beta)<br />This module allows users to login on a Drupal website through the Facebook Connect API – using their Facebook login and password.<br />The module also brings other extra features:<br />Users can see which of their Facebook friends already have an account on the Drupal website<br />Users can publish a customizable message on their Facebook feed announcing that they have created an account on the Drupal website<br />Users can invite their Facebook friends to create an account on the Drupal website<br />
  29. 29. To use facebook connect<br />Download the Facebook PHP libraries from http://svn.facebook.com/svnroot/platform/clients/packages/facebook-platform.tar.gz.<br />Copy the content of the "php" folder into the "facebook-client" folder,<br />Create a new application on fb: name it your site’s name http://www.facebook.com/developers/createapp.php<br />Configure the module through the 'Fbconnect' section of the 'Site configuration' menu,<br />use the information provided by Facebook (API key, Secret API key). <br />When editing configuration, make sure your facebook session's is active<br />
  30. 30. WSIWYG editor<br />http://drupal.org/project/wysiwyg<br />WSIWYG is in alpha now.<br />It should be in beta in a couple of weeks.<br />Wysiwyg module allows you to use client-side editors (a.k.a. WYSIWYG editors) to edit content in Drupal. It simplifies installation and integration of editors and allows to assign an editor to each input format.<br />
  31. 31. Ubercart for commerce solutions<br />Ubercart is an e-commerce suite developed for Drupal. <br />It has been designed with the end user in mind, focusing on usability in three key areas: <br />store configuration, <br />product and catalog creation<br />order administration.<br />
  32. 32. Backup and migrate module<br />Allows you to take periodic backups of your SQL database only.<br />It will retrieve your SQL database.<br />You can use it to migrate site from a test installation to a live one.<br />