SlideShare a Scribd company logo
Count to 10 and Say Yes
     JOHN HENRY DONOVAN
      Engine Summit 7th June 2011
Count to 10 and Say Yes
Introduction
We have all been there. A client emails and makes an unreasonable
feature request. Our first response after the explosion of expletives
would be to say no. But let's count to 10 and rescue the situation.
Lateral thinking
•	For me personally, lateral thinking plays a big part when designing
  architecture for a clients web application/site							
  	
•	It's problem solving at it's lowest common denominator				
  	
•	In ExpressionEngine these problems present themselves all the
  time. I call it problem solving but it is really solution finding	
  	
•	Lateral thinking comes into play the more you become aware of the
  flexibility that EE has to offer. Your solution depends on the tools
  and knowledge you have at hand. It's about taking something you
  know and applying or seeing it in a different way.						
  	
•	Lets examine one of the most common over thought items in EE
{if news_image == "black"}
	
	   	   <img src="/images/black-image.jpg" />
	   	

	   {if:elseif news_image == "red"}
	
	   	   <img src="/images/red-image.jpg" />
	   	
	   {if:elseif news_image == "yellow"}
	
	   	   <img src="/images/yellow-image.jpg" />
	   	

	   {if:elseif news_image == "green"}
	
	   	   <img src="/images/green-image.jpg" />
	   	

	   {if:elseif news_image == "blue"}
	
	   	   <img src="/images/blue-image.jpg" />
	   	

	   {if:else}
	
	   	   <img src="/images/pink-image.jpg" />
	   	

	   {/if}
<img src="/images/{news_image}-image.jpg" />
The Member Export Tool
"We want to be able to export our members into Excel. Looking at
them in EE is all well and good but I want the data available to our
non-webeditors also. We have an a piece of software here in the
office that we want to import our members into"
The Member Export Tool
IMMEDIATE THOUGHTS

•	I just built you a whole website in ExpressionEngine, why do you
 need to do this??
•	There must be an add-on that does what they want
•	Punt the cat down the stairs
The Member Export Tool
LETS THINK ABOUT THIS

•	What are the exact reasons behind the client wanting this
•	There must be a gap in the workflow I created for them
•	It is something out of scope so lets do our best to make his flawless
•	Lets cover all angles
•	Lets turn this into a project that we can charge a client for and be
 happy with the outcome
The Member Export Tool
SPEC

•	Export as a downloadable CSV file
•	Choose today's date
•	Choose a specific date
•	Choose a date range
•	Make it all template based
•	Protect it from the public
Count to 10 and Say Yes
Count to 10 and Say Yes
http://www.mydomain.com/member-export/index
/member-export/index
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">

		       <title>Member Data Custom Export Tool</title>
		
		       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
		       <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
		       <script src="/global/js/daterangepicker.jQuery.js"></script>
		
		       <link href="/global/css/ui.daterangepicker.css" type="text/css" rel="stylesheet" />
		       <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/redmond/jquery-ui.css"
type="text/css" rel="stylesheet" />
		
		       <!-- demo-related styles -->
		       <link rel="stylesheet" type="text/css" media="all" href="{stylesheet=_includes/style}" />
		
		       <script type="text/javascript">	
			          $(function(){
		
				                $('input#range').daterangepicker( {
						                         text: 'My Range',
						                         dateStart: '2010-01-01',
						                         dateEnd: 'Today',
						                         dateFormat:'yy-mm-dd',
						                         rangeSplitter:'/',
						                         onClose: function(){
						                         	
                               var actionDate="/member-export/exporter/"+$("input#range").val();
						                         	
                               $("#export-tool").attr("action",actionDate);
						                         	
							                        }
  					               } );
			           });
		       </script>
	
	   </head>
/member-export/index (continued)



		      <body>
		
		      {if logged_out}
		
			         <h1>Bugger off!</h1>
			         <p>You must be a site administrator to view this page.</p>
			
		      {if:else}
		
		      <h1>Member Data Custom Export Tool</h1>
		      <form action="" id="export-tool">
			         <input type="text" value="Choose dates" id="range" />
			         <input class="submit" type="submit" value="Download"/>
		      </form>	
		
		      {/if}
		
	   </body>
</html>
The Member Export Tool
               member-export




                  exporter




    today        specific date   date range



            member-export.csv
/member-export/exporter

	 {if segment_3 == "" AND segment_4 == ""}
		    <h1>Bugger off!</h1>
		    <p>You must be a site administrator to view this page.</p>
	 {/if}
	
	
	 <!-- Check for todays date and show correct embed -->
	 {if segment_3 == "{current_time format='%Y-%m-%d'}" AND segment_4 == ""}
	 {embed="member-export/today" date1="{current_time format='Y-%m-%d'}"}
	 {/if}
	
	 <!-- Check for a specific date and show correct embed -->
	 {if segment_3 != "{current_time format='Y-%m-%d'}" AND segment_4 == "" AND segment_3 != ""}
	 {embed="member-export/specific-date" date1="{segment_3}"}
	 {/if}
	
	
	 <!-- Check for a date range and show correct embed -->
	 {if segment_3 != "" && segment_4 != ""}
	 {embed="member-export/date-range" date1="{segment_3}" date2="{segment_4}"}
	 {/if}
The Member Export Tool
               member-export




                  exporter




    today        specific date   date range



            member-export.csv
/member-export/today

	   {exp:ajw_export sql="SELECT
	   m.member_id AS 'Website Member Id',
	   date_format(from_unixtime(join_date), '%d/%m/%Y') AS 'Join Date',
	   m.username AS 'Username',
	   m.email AS 'Email',
	   m.url AS 'URL',
	   m_field_id_1 AS 'Subscribed to Newsletter'
	   FROM exp_members AS m LEFT JOIN exp_member_data AS d ON d.member_id = m.member_id
	   WHERE date_format(from_unixtime(join_date), '%d-%m-%Y')='{embed:date1}'
	   ORDER BY m.member_id DESC"
	   format="csv" filename="member-export.csv"
	   }
/member-export/specific-date

{exp:ajw_export sql="SELECT
	 m.member_id AS 'Website Member Id',
	 date_format(from_unixtime(join_date), '%d/%m/%Y') AS 'Join Date',
	 m.username AS 'Username',
	 m.email AS 'Email',
	 m.url AS 'URL',
	 m_field_id_1 AS 'Subscribed to Newsletter'
	 FROM exp_members AS m LEFT JOIN exp_member_data AS d ON d.member_id = m.member_id
	 WHERE date_format(from_unixtime(join_date), '%d-%m-%Y')='{embed:date1}'
	 ORDER BY m.member_id DESC"
	 format="csv" filename="member-export.csv"
	 }
/member-export/date-range

	 {exp:ajw_export sql="SELECT
	 m.member_id AS 'Website Member Id',
	 date_format(from_unixtime(join_date), '%d/%m/%Y') AS 'Join Date',
	 m.username AS 'Username',
	 m.email AS 'Email',
	 m.url AS 'URL',
	 m_field_id_1 AS 'Subscribed to Newsletter'
	 FROM exp_members AS m LEFT JOIN exp_member_data AS d ON d.member_id = m.member_id
	 WHERE date_format(from_unixtime(join_date), '%Y-%m-%d') BETWEEN '{embed:date1}' AND
'{embed:date2}'
	 ORDER BY m.member_id DESC"
	 format="csv" filename="member-export.csv"
	 }
http://www.mydomain.com/member-export/index
Count to 10 and Say Yes
Screenshare time!
Thanks
JOHN HENRY DONOVAN
    http://johnhenry.ie
      @johnhenry_ie

More Related Content

PDF
You're Doing it Wrong - WordCamp Orlando
KEY
Keeping It Simple
PDF
You're Doing it Wrong - WordCamp Atlanta
PPSX
WordPress Theme Design and Development Workshop - Day 3
TXT
Posts ‹ teslaecoenergy — word press php
ODP
HTML::FormHandler
PDF
Mume JQueryMobile Intro
PDF
Payments On Rails
You're Doing it Wrong - WordCamp Orlando
Keeping It Simple
You're Doing it Wrong - WordCamp Atlanta
WordPress Theme Design and Development Workshop - Day 3
Posts ‹ teslaecoenergy — word press php
HTML::FormHandler
Mume JQueryMobile Intro
Payments On Rails

What's hot (18)

PDF
20111014 mu me_j_querymobile
PPT
WordPress Third Party Authentication
PPT
jQuery 1.7 Events
PDF
Working with Javascript in Rails
PPT
WordPress as a Content Management System
PDF
Architecture, Auth, and Routing with uiRouter
PPTX
Cakefest 2010: API Development
PPTX
Client side development with knockout.js
KEY
Single Page Web Apps with Backbone.js and Rails
PPTX
jQuery Plugin
PPTX
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
PDF
Devoxx 2014-webComponents
PDF
Turn your spaghetti code into ravioli with JavaScript modules
PDF
[ WrocLoveRb 2012] user perspective testing using ruby
PPT
Introduction to Zend_Pdf
PDF
Dicas de palestra
PPTX
Angular 2.0 Routing and Navigation
PDF
Laravel admin20170819
20111014 mu me_j_querymobile
WordPress Third Party Authentication
jQuery 1.7 Events
Working with Javascript in Rails
WordPress as a Content Management System
Architecture, Auth, and Routing with uiRouter
Cakefest 2010: API Development
Client side development with knockout.js
Single Page Web Apps with Backbone.js and Rails
jQuery Plugin
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Devoxx 2014-webComponents
Turn your spaghetti code into ravioli with JavaScript modules
[ WrocLoveRb 2012] user perspective testing using ruby
Introduction to Zend_Pdf
Dicas de palestra
Angular 2.0 Routing and Navigation
Laravel admin20170819
Ad

Viewers also liked (20)

PPTX
Enterprise Risk Management
PPTX
Government encourages education loan
PDF
Jquery for post a form
PPTX
Good mobile design of financial industry websites
PDF
Amir33202057 2013 03-17-19-06-07
PPTX
Q1.0 [Quiz Quirks]
PPTX
From User to Global: A Spectrum of Experience
PPTX
Ship It!
PPT
Small business solutions worldwide
PDF
Automated Test Design: Single Use Vs Reusable Tests
PDF
Digitalisierung mit UNIT4
PDF
Starting up - Lessons learned from the trenches
DOCX
Digital economy with the speed of s4 hana
PDF
EarthLink Top 5 Questions Asked of EarthLInk Network Engineers 2016
PDF
4月23日説明会
PPTX
Business Intelligence: A Financial Perspective
PPTX
Are you and your computer guy praying 3
PDF
Serveau software f
PPT
Currency matters trading platform vision v1.1
PDF
HubSpot Activation on BlueCamroo
Enterprise Risk Management
Government encourages education loan
Jquery for post a form
Good mobile design of financial industry websites
Amir33202057 2013 03-17-19-06-07
Q1.0 [Quiz Quirks]
From User to Global: A Spectrum of Experience
Ship It!
Small business solutions worldwide
Automated Test Design: Single Use Vs Reusable Tests
Digitalisierung mit UNIT4
Starting up - Lessons learned from the trenches
Digital economy with the speed of s4 hana
EarthLink Top 5 Questions Asked of EarthLInk Network Engineers 2016
4月23日説明会
Business Intelligence: A Financial Perspective
Are you and your computer guy praying 3
Serveau software f
Currency matters trading platform vision v1.1
HubSpot Activation on BlueCamroo
Ad

Similar to Count to 10 and Say Yes (20)

PDF
Building iPhone Web Apps using "classic" Domino
TXT
Private slideshow
PDF
Once Source to Rule Them All
KEY
Taking your Web App for a walk
PPTX
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
PPTX
Python Code Camp for Professionals 1/4
PDF
Rails GUI Development with Ext JS
PDF
Max Voloshin - "Organization of frontend development for products with micros...
PPTX
Site optimization
TXT
Xxx
PDF
HTML5 New and Improved
PDF
Pengenalan AngularJS
PDF
More Secrets of JavaScript Libraries
KEY
#NewMeetup Performance
PDF
Your Custom WordPress Admin Pages Suck
PDF
Why you should be using Web Components. And How - DevWeek 2015
KEY
关于 Html5 那点事
PPSX
Introduction to Html5
PPTX
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
DOCX
Borrador del blog
Building iPhone Web Apps using "classic" Domino
Private slideshow
Once Source to Rule Them All
Taking your Web App for a walk
Design Patterns for JavaScript Web Apps - JavaScript Conference 2012 - OPITZ ...
Python Code Camp for Professionals 1/4
Rails GUI Development with Ext JS
Max Voloshin - "Organization of frontend development for products with micros...
Site optimization
Xxx
HTML5 New and Improved
Pengenalan AngularJS
More Secrets of JavaScript Libraries
#NewMeetup Performance
Your Custom WordPress Admin Pages Suck
Why you should be using Web Components. And How - DevWeek 2015
关于 Html5 那点事
Introduction to Html5
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Borrador del blog

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Encapsulation theory and applications.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
Building Integrated photovoltaic BIPV_UPV.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cuic standard and advanced reporting.pdf
NewMind AI Monthly Chronicles - July 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Review of recent advances in non-invasive hemoglobin estimation
Spectral efficient network and resource selection model in 5G networks
Encapsulation theory and applications.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Machine learning based COVID-19 study performance prediction
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Count to 10 and Say Yes

  • 1. Count to 10 and Say Yes JOHN HENRY DONOVAN Engine Summit 7th June 2011
  • 3. Introduction We have all been there. A client emails and makes an unreasonable feature request. Our first response after the explosion of expletives would be to say no. But let's count to 10 and rescue the situation.
  • 4. Lateral thinking • For me personally, lateral thinking plays a big part when designing architecture for a clients web application/site • It's problem solving at it's lowest common denominator • In ExpressionEngine these problems present themselves all the time. I call it problem solving but it is really solution finding • Lateral thinking comes into play the more you become aware of the flexibility that EE has to offer. Your solution depends on the tools and knowledge you have at hand. It's about taking something you know and applying or seeing it in a different way. • Lets examine one of the most common over thought items in EE
  • 5. {if news_image == "black"} <img src="/images/black-image.jpg" /> {if:elseif news_image == "red"} <img src="/images/red-image.jpg" /> {if:elseif news_image == "yellow"} <img src="/images/yellow-image.jpg" /> {if:elseif news_image == "green"} <img src="/images/green-image.jpg" /> {if:elseif news_image == "blue"} <img src="/images/blue-image.jpg" /> {if:else} <img src="/images/pink-image.jpg" /> {/if}
  • 7. The Member Export Tool "We want to be able to export our members into Excel. Looking at them in EE is all well and good but I want the data available to our non-webeditors also. We have an a piece of software here in the office that we want to import our members into"
  • 8. The Member Export Tool IMMEDIATE THOUGHTS • I just built you a whole website in ExpressionEngine, why do you need to do this?? • There must be an add-on that does what they want • Punt the cat down the stairs
  • 9. The Member Export Tool LETS THINK ABOUT THIS • What are the exact reasons behind the client wanting this • There must be a gap in the workflow I created for them • It is something out of scope so lets do our best to make his flawless • Lets cover all angles • Lets turn this into a project that we can charge a client for and be happy with the outcome
  • 10. The Member Export Tool SPEC • Export as a downloadable CSV file • Choose today's date • Choose a specific date • Choose a date range • Make it all template based • Protect it from the public
  • 14. /member-export/index <!DOCTYPE HTML> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <title>Member Data Custom Export Tool</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script> <script src="/global/js/daterangepicker.jQuery.js"></script> <link href="/global/css/ui.daterangepicker.css" type="text/css" rel="stylesheet" /> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/redmond/jquery-ui.css" type="text/css" rel="stylesheet" /> <!-- demo-related styles --> <link rel="stylesheet" type="text/css" media="all" href="{stylesheet=_includes/style}" /> <script type="text/javascript"> $(function(){ $('input#range').daterangepicker( { text: 'My Range', dateStart: '2010-01-01', dateEnd: 'Today', dateFormat:'yy-mm-dd', rangeSplitter:'/', onClose: function(){ var actionDate="/member-export/exporter/"+$("input#range").val(); $("#export-tool").attr("action",actionDate); } } ); }); </script> </head>
  • 15. /member-export/index (continued) <body> {if logged_out} <h1>Bugger off!</h1> <p>You must be a site administrator to view this page.</p> {if:else} <h1>Member Data Custom Export Tool</h1> <form action="" id="export-tool"> <input type="text" value="Choose dates" id="range" /> <input class="submit" type="submit" value="Download"/> </form> {/if} </body> </html>
  • 16. The Member Export Tool member-export exporter today specific date date range member-export.csv
  • 17. /member-export/exporter {if segment_3 == "" AND segment_4 == ""} <h1>Bugger off!</h1> <p>You must be a site administrator to view this page.</p> {/if} <!-- Check for todays date and show correct embed --> {if segment_3 == "{current_time format='%Y-%m-%d'}" AND segment_4 == ""} {embed="member-export/today" date1="{current_time format='Y-%m-%d'}"} {/if} <!-- Check for a specific date and show correct embed --> {if segment_3 != "{current_time format='Y-%m-%d'}" AND segment_4 == "" AND segment_3 != ""} {embed="member-export/specific-date" date1="{segment_3}"} {/if} <!-- Check for a date range and show correct embed --> {if segment_3 != "" && segment_4 != ""} {embed="member-export/date-range" date1="{segment_3}" date2="{segment_4}"} {/if}
  • 18. The Member Export Tool member-export exporter today specific date date range member-export.csv
  • 19. /member-export/today {exp:ajw_export sql="SELECT m.member_id AS 'Website Member Id', date_format(from_unixtime(join_date), '%d/%m/%Y') AS 'Join Date', m.username AS 'Username', m.email AS 'Email', m.url AS 'URL', m_field_id_1 AS 'Subscribed to Newsletter' FROM exp_members AS m LEFT JOIN exp_member_data AS d ON d.member_id = m.member_id WHERE date_format(from_unixtime(join_date), '%d-%m-%Y')='{embed:date1}' ORDER BY m.member_id DESC" format="csv" filename="member-export.csv" }
  • 20. /member-export/specific-date {exp:ajw_export sql="SELECT m.member_id AS 'Website Member Id', date_format(from_unixtime(join_date), '%d/%m/%Y') AS 'Join Date', m.username AS 'Username', m.email AS 'Email', m.url AS 'URL', m_field_id_1 AS 'Subscribed to Newsletter' FROM exp_members AS m LEFT JOIN exp_member_data AS d ON d.member_id = m.member_id WHERE date_format(from_unixtime(join_date), '%d-%m-%Y')='{embed:date1}' ORDER BY m.member_id DESC" format="csv" filename="member-export.csv" }
  • 21. /member-export/date-range {exp:ajw_export sql="SELECT m.member_id AS 'Website Member Id', date_format(from_unixtime(join_date), '%d/%m/%Y') AS 'Join Date', m.username AS 'Username', m.email AS 'Email', m.url AS 'URL', m_field_id_1 AS 'Subscribed to Newsletter' FROM exp_members AS m LEFT JOIN exp_member_data AS d ON d.member_id = m.member_id WHERE date_format(from_unixtime(join_date), '%Y-%m-%d') BETWEEN '{embed:date1}' AND '{embed:date2}' ORDER BY m.member_id DESC" format="csv" filename="member-export.csv" }
  • 25. Thanks JOHN HENRY DONOVAN http://johnhenry.ie @johnhenry_ie