Pods	
  +	
  WP	
  =	
  CMS	
  
          Sort	
  of	
  …	
  	
  
What	
  do	
  we	
  want	
  in	
  a	
  CMS?	
  



•  Flexible	
  –	
  Does	
  different	
  things	
  	
  
•  Robust	
  –	
...
Is	
  Wordpress	
  a	
  CMS?	
  Yes	
  


•  Wordpress	
  is	
  really	
  good	
  at	
  publishing	
  one	
  
   kind	
  o...
Is	
  Wordpress	
  a	
  CMS?	
  No	
  	
  


•  Major	
  challenges	
  customizing	
  backend	
  UI	
  
•  All	
  post	
  ...
So	
  what?	
  


•  Time	
  is	
  money	
  
•  Consultants	
  need	
  to	
  maximize	
  funcMonality/
   Mme	
  equaMon.	...
Custom	
  Fields	
  


•  Good	
  for	
  on	
  the	
  fly	
  customizaMon	
  
•  Bad	
  for	
  complex	
  content	
  types	...
Querying	
  Custom	
  Fields	
  


$args	
  =	
  “meta_key=airline_name&value=American”;	
  
$args	
  =	
  “meta_key=arriv...
MulMple	
  custom	
  fields?	
  

funcMon	
  get_post_meta_mulMple($metaDataList)	
  {	
  
     	
  global	
  $wpdb;	
  

 ...
Scalability	
  


•  Most	
  wordpress	
  users	
  will	
  never	
  experience	
  
   performance	
  issues	
  because	
  ...
Scalability	
  


•  All	
  posts/types	
  are	
  in	
  one	
  table.	
  
•  All	
  custom	
  fields	
  are	
  in	
  longte...
So	
  What	
  are/is	
  Pods?	
  


•  Not	
  a	
  plugin	
  …	
  really	
  
•  Pods	
  =	
  Simple,	
  scalable,	
  CMS	
...
Example:	
  Flight	
  List	
  
Example:	
  Flight	
  List	
  
Example:	
  Flight	
  List	
  
Example:	
  Flight	
  List	
  
Example:	
  Flight	
  List	
  
Example:	
  Flight	
  List	
  
Example:	
  Flight	
  List	
  
Example:	
  Flight	
  List	
  
Example:	
  TemplaMng	
  
Example:	
  TemplaMng	
  

<?php	
  
$flight	
  =	
  new	
  Pod(‘flight’);	
  
$flight-­‐>findRecords(‘arrives	
  ASC’,	
  -­‐...
Example:	
  TemplaMng	
  
Example:	
  TemplaMng	
  


   {@field.column}	
  
Example:	
  TemplaMng	
  

{@airline.name}	
  -­‐	
  {@name},	
  {@departs}	
  <br/>	
  
Example:	
  TemplaMng	
  
hsp://www.yourdomain.com/flights/	
  
Example:	
  TemplaMng	
  
hsp://www.yourdomain.com/flights/?airline=2	
  
Example:	
  TemplaMng	
  

<?php	
  
$flight	
  =	
  new	
  Pod(‘flight’);	
  
$flight-­‐>findRecords(‘arrives	
  ASC’,	
  -­‐...
Example:	
  TemplaMng	
  
Example:	
  TemplaMng	
  

<?php	
  
$form	
  =	
  new	
  Pod('flight');	
  
echo	
  $form-­‐>publicForm();	
  
?>	
  
Example:	
  TemplaMng	
  
Example:	
  TemplaMng	
  

<?php	
  
$form	
  =	
  new	
  Pod('flight');	
  
$fields	
  =	
  array('name','arrive','depart')...
Example:	
  TemplaMng	
  
Example:	
  TemplaMng	
  
Showcase	
  
MulMple	
  custom	
  fields?	
  

funcMon	
  get_post_meta_mulMple($metaDataList)	
  {	
  
     	
  global	
  $wpdb;	
  

 ...
Showcase	
  


<?php	
  
$di	
  =	
  new	
  Pod('distress_index');	
  
$di-­‐>findRecords('name	
  DESC',	
  -­‐1,	
  "t.un...
Scalability	
  


•  Using	
  Custom	
  Fields:	
  
    –  600	
  rows	
  x	
  6	
  custom	
  fields	
  =	
  3600	
  table	...
Showcase	
  
What	
  about	
  Custom	
  
                 Taxonomies/Post	
  Types?	
  	
  

•  Wordpress	
  argues	
  that	
  custom	
...
Pods-­‐nosis	
  NegaMve? 	
  	
  

•  Because	
  pods	
  data	
  is	
  saved	
  in	
  separate	
  tables,	
  
   standard	...
Why	
  use	
  pods? 	
  	
  


•  Learn	
  one	
  plugin,	
  build	
  anything	
  you	
  want.	
  
•  Your	
  site	
  has	...
Summary	
  	
  


•  There	
  is	
  no	
  RIGHT	
  way	
  to	
  use	
  Wordpress	
  as	
  a	
  
   CMS.	
  
•  Pods	
  is	...
More	
  info?	
  


•  www.podscms.org 	
  	
  
•  www.mikevanwinkle.com	
  	
  
•  @podscms,	
  @mpvanwinkle	
  
A	
  QuesMon?	
  


•  Should	
  Wordpress.org	
  abandon	
  it’s	
  own	
  
   asempts	
  to	
  make	
  WP	
  a	
  CMS?	
...
Upcoming SlideShare
Loading in …5
×

Wordcamp Fayetteville Pods Presentation (PDF)

1,542 views

Published on

Published in: Technology

Wordcamp Fayetteville Pods Presentation (PDF)

  1. 1. Pods  +  WP  =  CMS   Sort  of  …    
  2. 2. What  do  we  want  in  a  CMS?   •  Flexible  –  Does  different  things     •  Robust  –  Does  things  well  
  3. 3. Is  Wordpress  a  CMS?  Yes   •  Wordpress  is  really  good  at  publishing  one   kind  of  content:  the  Post   •  Its  interface  is  easy  to  learn  and  easy  to  teach.     •  Theming  is  especially  powerful.  Design   community   •  Plugins  and  custom  fields  provide  addiMonal   flexibility  on  a  post  by  post  basis.    
  4. 4. Is  Wordpress  a  CMS?  No     •  Major  challenges  customizing  backend  UI   •  All  post  types  essenMally  the  same   •  Custom  fields  difficult  to  work  with  in  complex   ways   •  Scalability  issues  
  5. 5. So  what?   •  Time  is  money   •  Consultants  need  to  maximize  funcMonality/ Mme  equaMon.  
  6. 6. Custom  Fields   •  Good  for  on  the  fly  customizaMon   •  Bad  for  complex  content  types  
  7. 7. Querying  Custom  Fields   $args  =  “meta_key=airline_name&value=American”;   $args  =  “meta_key=arrives&meta_compare=>=&meta_value=DATE()”   query_posts($args);  
  8. 8. MulMple  custom  fields?   funcMon  get_post_meta_mulMple($metaDataList)  {    global  $wpdb;    $querystr  =  "SELECT  p.*  FROM  $wpdb-­‐>posts  AS  p  WHERE  p.ID  IN  (  ";    $querystr  .=  "SELECT  post_id  FROM  $wpdb-­‐>postmeta  WHERE  ";    $innerqry  =  array();    foreach($metaDataList  as  $key  =>  $value)  {      $innerqry[]  =  $wpdb-­‐>prepare(  "(meta_key  =  %s  AND  meta_value  =  %s)",  $key,  $value  );      }    $querystr  .=  implode("  OR  ",  $innerqry);    $querystr  .=  "  GROUP  BY  post_id  ";    $querystr  .=  "HAVING  count(*)  =  "  .  count($metaDataList);    $querystr  .=  ")  AND  p.post_status  =  'publish'  ";    $metaResults  =  $wpdb-­‐>get_results($querystr,  OBJECT);              return  $metaResults;   }   Source:  hsp://Mnyurl.com/ldadam  
  9. 9. Scalability   •  Most  wordpress  users  will  never  experience   performance  issues  because  the  number   pages  just  isn’t  enough  to  maser.     •  But  consultants  sMll  need  to  be  concerned.    
  10. 10. Scalability   •  All  posts/types  are  in  one  table.   •  All  custom  fields  are  in  longtext  format  which   means  they  can  store  up  to  4GB.   •  Table  sizes  are  effecMvely  doubled  by  custom   fields  10,000  posts  with  10  cfs  each  is  like   having  100,000  rows.  Add  in  revisions  and   even  simple  queries  become  hogs.    
  11. 11. So  What  are/is  Pods?   •  Not  a  plugin  …  really   •  Pods  =  Simple,  scalable,  CMS  soluMon  for   Wordpress.   •  UlMmate  flexibility  with  being  too  Mme   intensive.     •  Frontend/Backend  CustomizaMon  a  cinch.      
  12. 12. Example:  Flight  List  
  13. 13. Example:  Flight  List  
  14. 14. Example:  Flight  List  
  15. 15. Example:  Flight  List  
  16. 16. Example:  Flight  List  
  17. 17. Example:  Flight  List  
  18. 18. Example:  Flight  List  
  19. 19. Example:  Flight  List  
  20. 20. Example:  TemplaMng  
  21. 21. Example:  TemplaMng   <?php   $flight  =  new  Pod(‘flight’);   $flight-­‐>findRecords(‘arrives  ASC’,  -­‐1);   echo  $flight-­‐>showTemplate(‘flight-­‐list’);   ?>  
  22. 22. Example:  TemplaMng  
  23. 23. Example:  TemplaMng   {@field.column}  
  24. 24. Example:  TemplaMng   {@airline.name}  -­‐  {@name},  {@departs}  <br/>  
  25. 25. Example:  TemplaMng   hsp://www.yourdomain.com/flights/  
  26. 26. Example:  TemplaMng   hsp://www.yourdomain.com/flights/?airline=2  
  27. 27. Example:  TemplaMng   <?php   $flight  =  new  Pod(‘flight’);   $flight-­‐>findRecords(‘arrives  ASC’,  -­‐1);   echo  $flight-­‐>getFilters(‘airline’,  ‘Filter’);   echo  $flight-­‐>showTemplate(‘flight-­‐list’);   ?>  
  28. 28. Example:  TemplaMng  
  29. 29. Example:  TemplaMng   <?php   $form  =  new  Pod('flight');   echo  $form-­‐>publicForm();   ?>  
  30. 30. Example:  TemplaMng  
  31. 31. Example:  TemplaMng   <?php   $form  =  new  Pod('flight');   $fields  =  array('name','arrive','depart');   echo  $form-­‐>publicForm();   echo   ?>   $form-­‐>publicForm($fields);   ?>  
  32. 32. Example:  TemplaMng  
  33. 33. Example:  TemplaMng  
  34. 34. Showcase  
  35. 35. MulMple  custom  fields?   funcMon  get_post_meta_mulMple($metaDataList)  {    global  $wpdb;    $querystr  =  "SELECT  p.*  FROM  $wpdb-­‐>posts  AS  p  WHERE  p.ID  IN  (  ";    $querystr  .=  "SELECT  post_id  FROM  $wpdb-­‐>postmeta  WHERE  ";    $innerqry  =  array();    foreach($metaDataList  as  $key  =>  $value)  {      $innerqry[]  =  $wpdb-­‐>prepare(  "(meta_key  =  %s  AND  meta_value  =  %s)",  $key,  $value  );      }    $querystr  .=  implode("  OR  ",  $innerqry);    $querystr  .=  "  GROUP  BY  post_id  ";    $querystr  .=  "HAVING  count(*)  =  "  .  count($metaDataList);    $querystr  .=  ")  AND  p.post_status  =  'publish'  ";    $metaResults  =  $wpdb-­‐>get_results($querystr,  OBJECT);              return  $metaResults;   }   Source:  hsp://Mnyurl.com/ldadam  
  36. 36. Showcase   <?php   $di  =  new  Pod('distress_index');   $di-­‐>findRecords('name  DESC',  -­‐1,  "t.un  >  6.00  AND  t.cpi  <  2.00");   echo  $di-­‐>showTemplate('distress_data_table');   ?>  
  37. 37. Scalability   •  Using  Custom  Fields:   –  600  rows  x  6  custom  fields  =  3600  table  rows   •  Using  Pods:   –  600  table  rows  
  38. 38. Showcase  
  39. 39. What  about  Custom   Taxonomies/Post  Types?     •  Wordpress  argues  that  custom  taxonomies   and  the  introducMon  of  post  types  alleviates   the  need  for  excessive  use  of  custom  fields.     •  But  this  only  increases  the  scalability  slightly,   there  are  sMll  problems  for  large  sites.    
  40. 40. Pods-­‐nosis  NegaMve?     •  Because  pods  data  is  saved  in  separate  tables,   standard  Wordpress  post  features  are  not   available.  (i.e.  comments/akismet)   •  Wordpress  does  not  currently  endorse  the  pods   cms  strategy  and  instead  is  pushing  the  “one  post   type  fits  all  strategy”.   •  Pods  community  is  considerably  smaller  than  the   wordpress  community.    
  41. 41. Why  use  pods?     •  Learn  one  plugin,  build  anything  you  want.   •  Your  site  has  lots  of  relaMonships  between   types  of  content.   •  Scalability  is  a  concern.     •  Truly  custom,  customizaMon  
  42. 42. Summary     •  There  is  no  RIGHT  way  to  use  Wordpress  as  a   CMS.   •  Pods  is  a  tool  for  developers,  not  users.     •  Pods  is  the  most  flexible/scalable  CMS  opDon   currently  available  for  Wordpress.    
  43. 43. More  info?   •  www.podscms.org     •  www.mikevanwinkle.com     •  @podscms,  @mpvanwinkle  
  44. 44. A  QuesMon?   •  Should  Wordpress.org  abandon  it’s  own   asempts  to  make  WP  a  CMS?  Can  WP  be   everything  to  everyone?    

×