Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Count to 10 and Say Yes

Count to 10 and Say Yes

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

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.

John Henry talks about breaking down these requests and translating them into clever ExpressionEngine architecture using real world examples.

He shows how he converts a client's idea into a chargeable item and impress them in the process.

Lateral thinking plays a fundamental part when developing an ExpressionEngine website and John Henry teaches you how to use this to your advantage.

John Henry Donovan

June 07, 2011
Tweet

More Decks by John Henry Donovan

Other Decks in Technology

Transcript

  1. 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.
  2. 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
  3. {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}
  4. 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"
  5. 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
  6. 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
  7. 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
  8. <!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
  9. <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> /member-export/index (continued)
  10. {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} /member-export/exporter
  11. {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/today
  12. {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
  13. /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" }