Your SlideShare is downloading. ×
0
Count to 10 and Say Yes     JOHN HENRY DONOVAN      Engine Summit 7th June 2011
IntroductionWe have all been there. A client emails and makes an unreasonablefeature request. Our first response after the...
Lateral thinking•	For me personally, lateral thinking plays a big part when designing  architecture for a clients web appl...
{if news_image == "black"}		   	   <img src="/images/black-image.jpg" />	   		   {if:elseif news_image == "red"}		   	   <...
<img src="/images/{news_image}-image.jpg" />
The Member Export Tool"We want to be able to export our members into Excel. Looking atthem in EE is all well and good but ...
The Member Export ToolIMMEDIATE THOUGHTS•	I just built you a whole website in ExpressionEngine, why do you need to do this...
The Member Export ToolLETS THINK ABOUT THIS•	What are the exact reasons behind the client wanting this•	There must be a ga...
The Member Export ToolSPEC•	Export as a downloadable CSV file•	Choose todays date•	Choose a specific date•	Choose a date r...
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-export/index (continued)		      <body>				      {if logged_out}					         <h1>Bugger off!</h1>			         <p>Yo...
The Member Export Tool               member-export                  exporter    today        specific date   date range   ...
/member-export/exporter	 {if segment_3 == "" AND segment_4 == ""}		    <h1>Bugger off!</h1>		    <p>You must be a site adm...
The Member Export Tool               member-export                  exporter    today        specific date   date range   ...
/member-export/today	   {exp:ajw_export sql="SELECT	   m.member_id AS Website Member Id,	   date_format(from_unixtime(join...
/member-export/specific-date{exp:ajw_export sql="SELECT	 m.member_id AS Website Member Id,	 date_format(from_unixtime(join...
/member-export/date-range	 {exp:ajw_export sql="SELECT	 m.member_id AS Website Member Id,	 date_format(from_unixtime(join_...
http://www.mydomain.com/member-export/index
Screenshare time!
ThanksJOHN HENRY DONOVAN    http://johnhenry.ie      @johnhenry_ie
Count to 10 and Say Yes
Count to 10 and Say Yes
Count to 10 and Say Yes
Count to 10 and Say Yes
Upcoming SlideShare
Loading in...5
×

Count to 10 and Say Yes

367

Published on

Originally presented at Engine Summit - The online ExpressionEngine Summit June, 7thth 2011

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
367
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Count to 10 and Say Yes"

  1. 1. Count to 10 and Say Yes JOHN HENRY DONOVAN Engine Summit 7th June 2011
  2. 2. IntroductionWe have all been there. A client emails and makes an unreasonablefeature request. Our first response after the explosion of expletiveswould be to say no. But lets count to 10 and rescue the situation.
  3. 3. Lateral thinking• For me personally, lateral thinking plays a big part when designing architecture for a clients web application/site • Its problem solving at its 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. Its 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
  4. 4. {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}
  5. 5. <img src="/images/{news_image}-image.jpg" />
  6. 6. The Member Export Tool"We want to be able to export our members into Excel. Looking atthem in EE is all well and good but I want the data available to ournon-webeditors also. We have an a piece of software here in theoffice that we want to import our members into"
  7. 7. The Member Export ToolIMMEDIATE 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
  8. 8. The Member Export ToolLETS 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
  9. 9. The Member Export ToolSPEC• Export as a downloadable CSV file• Choose todays date• Choose a specific date• Choose a date range• Make it all template based• Protect it from the public
  10. 10. http://www.mydomain.com/member-export/index
  11. 11. /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>
  12. 12. /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>
  13. 13. The Member Export Tool member-export exporter today specific date date range member-export.csv
  14. 14. /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}
  15. 15. The Member Export Tool member-export exporter today specific date date range member-export.csv
  16. 16. /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" }
  17. 17. /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" }
  18. 18. /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" }
  19. 19. http://www.mydomain.com/member-export/index
  20. 20. Screenshare time!
  21. 21. ThanksJOHN HENRY DONOVAN http://johnhenry.ie @johnhenry_ie
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×