Drupal Tips n Tricks   Michail Mavrommatis      John Tsevdos
Who we areMichail Mavrommatis        John Tsevdos   Wedia (mmav@wedia.gr)      Wedia (john@wedia.gr)                      ...
Agenda Top 3 Performance Hints 5 Modules to Improve User Administration Theming Tips
Performance Hints CCK fields    Do you really know the structure?    Avoid Using Multivalued CCK Fields if it is not a    ...
Performance Hints      Rewrite queries when necessary        Hook customviews_views_pre_execute(&$view) {    function cust...
5 Modules to Improve User AdministrationWe really love Drupals concept! We do not need any Administration Theme!1.   Taxon...
Theming - How we do it Base theme Customization Less module Skinr module Views + Cycle plug in = love
Base theme (aka as parent theme) Zen    its more than a simple parent theme    its straightforward and easy to adapt    ni...
Customization Child theme (Zens starterkit) Areas (instead of panels) template.php (instead of template re-writes) templat...
Less module CSS on steroids (http://lesscss.org/)    Variables    Mixins    Nested rules    Operations Progressive enhance...
Less module Code example                                                       #header { .rounded_corners; }#footer { .   ...
Skinr module      helps you to define a set of reusable and modular CSS      styles         Block         Node         Vie...
Views + Cycle plug in = love  Views  jQuery Cycle Plugin (http://jquery.malsup.com/cycle/)  Examples     Woop.gr     leofo...
            Panels               vs              Areas     (*.tpl - template.php)
Questions?Tip Of the DayDrupal Is an eclectic CMS                                                Use eclectic modules Only
Upcoming SlideShare
Loading in …5
×

Drupal tips 'n tricks

1,767 views
1,733 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,767
On SlideShare
0
From Embeds
0
Number of Embeds
890
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Drupal tips 'n tricks

  1. 1. Drupal Tips n Tricks Michail Mavrommatis John Tsevdos
  2. 2. Who we areMichail Mavrommatis John Tsevdos Wedia (mmav@wedia.gr) Wedia (john@wedia.gr) Tsevdos.com Phrappe.com @tsevdos
  3. 3. Agenda Top 3 Performance Hints 5 Modules to Improve User Administration Theming Tips
  4. 4. Performance Hints CCK fields Do you really know the structure? Avoid Using Multivalued CCK Fields if it is not a necessity Dispatch Fileds If necessary Avoid Using Shared CCK fields Avoid Multiple Node Loads  TIP: USE $global current_node;
  5. 5. Performance Hints Rewrite queries when necessary Hook customviews_views_pre_execute(&$view) {    function customviews_views_pre_execute(&$view) {       if ($view->name == user_views) && ($view->current_display == block_1)  {   $view->build_info[query] = str_replace(WHERE, "WHERE users.access <> 0 AND ", $view->build_info[query]);        $view->build_info[count_query] =                     str_replace(WHERE, "WHERE users.access <> 0 AND ", $view->build_info[count_query]);       }    }    
  6. 6. 5 Modules to Improve User AdministrationWe really love Drupals concept! We do not need any Administration Theme!1. Taxonomy Super Select2. Taxonomy Hierarchical Select3. Vertical Tabs4. Region Visibility5. Override node optionsHint: Do not hesitate to use hook form Alter to hideunwanted buttons! (I.e. Do you really need preview button?)
  7. 7. Theming - How we do it Base theme Customization Less module Skinr module Views + Cycle plug in = love
  8. 8. Base theme (aka as parent theme) Zen its more than a simple parent theme its straightforward and easy to adapt nice CSS structure (different CSS files for drupal elements such as blocks, views, nodes, panels, etc.) Considering move to Basic theme Fusion Framework and many more...
  9. 9. Customization Child theme (Zens starterkit) Areas (instead of panels) template.php (instead of template re-writes) template files (node, node-teaser, etc.)
  10. 10. Less module CSS on steroids (http://lesscss.org/) Variables Mixins Nested rules Operations Progressive enhancement (css3.less) Code seperation (colors.less)
  11. 11. Less module Code example #header { .rounded_corners; }#footer { . Code example rounded_corners(5px); }/* Variables */@brand_color:#ccc;#header { /* Nested Rules */#header { color:red; a { font- weight: bold; text-decoration: none;  }}background:@brand_color; }h2 { color:@brand_color; }/* Mixins */.rounded_corners (@radius:10px) {-moz-border-radius:@radius;-webkit-border-radius:@radius;border-radius:@radius;}
  12. 12. Skinr module helps you to define a set of reusable and modular CSS styles Block Node View Panel Easy to configure (.info file)skinr[rounded][title] = Rounded cornersskinr[rounded][description] = Add a 1em border radius for supportedbrowsers.skinr[rounded][options][1][label] = Rounded Cornersskinr[rounded][options][1][class] = rounded
  13. 13. Views + Cycle plug in = love Views jQuery Cycle Plugin (http://jquery.malsup.com/cycle/) Examples Woop.gr leoforos.gr
  14. 14.   Panels  vs  Areas  (*.tpl - template.php)
  15. 15. Questions?Tip Of the DayDrupal Is an eclectic CMS                                                Use eclectic modules Only

×