Slide 1

Slide 1 text

by Blake Walters at EECI, Austin, TX on October ,  DIVING IN: PRACTICAL TIPS FOR WRITING CUSTOM PLUGINS

Slide 2

Slide 2 text

EECI HELPED CHANGE HOW I BUILD SITES

Slide 3

Slide 3 text

‎ New development workflow ‎ Always up-to-date base install ‎ The template partials approach ‎ Custom add-on development

Slide 4

Slide 4 text

‎ New development workflow ‎ Always up-to-date base install ‎ The template partials approach ‎ Custom add-on development

Slide 5

Slide 5 text

‎ New development workflow ‎ Always up-to-date base install ‎ The template partials approach ‎ Custom add-on development

Slide 6

Slide 6 text

‎ New development workflow ‎ Always up-to-date base install ‎ The template partials approach ‎ Custom add-on development

Slide 7

Slide 7 text

expressionengine.com/user_guide/ CREDITS

Slide 8

Slide 8 text

devot-ee.com CREDITS

Slide 9

Slide 9 text

google.com CREDITS

Slide 10

Slide 10 text

ExpressionEngine Control Panel CREDITS

Slide 11

Slide 11 text

ExpressionEngine Control Panel CREDITS

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

‎ It’s notoriously slow [1] ‎ It’s not “user” friendly ‎ It’s not at all portable ‎ It locks you into a single parsing stage ‎ It gives you the “I’ll just enable PHP” mindset WHY NOT IN-TEMPLATE PHP? [1] http://www.gregaker.net/2010/oct/28/with-great-power-comes-great-responsibility/

Slide 14

Slide 14 text

‎ It’s notoriously slow ‎ It’s not “user” friendly ‎ It’s not at all portable ‎ It locks you into a single parsing stage ‎ It gives you the “I’ll just enable PHP” mindset WHY NOT IN-TEMPLATE PHP?

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

‎ It’s notoriously slow ‎ It’s not “user” friendly ‎ It’s not at all portable ‎ It locks you into a single parsing stage ‎ It gives you the “I’ll just enable PHP” mindset WHY NOT IN-TEMPLATE PHP?

Slide 17

Slide 17 text

‎ It’s notoriously slow ‎ It’s not “user” friendly ‎ It’s not at all portable ‎ It locks you into a single parsing stage ‎ It gives you the “I’ll just enable PHP” mindset WHY NOT IN-TEMPLATE PHP?

Slide 18

Slide 18 text

PHP on Input PHP on Output EE Template Tags

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

‎ It’s notoriously slow ‎ It’s not “user” friendly ‎ It’s not at all portable ‎ It locks you into a single parsing stage ‎ It gives you the “I’ll just enable PHP” mindset WHY NOT IN-TEMPLATE PHP?

Slide 21

Slide 21 text

HOW ABOUT BUILDING A CUSTOM PLUGIN?

Slide 22

Slide 22 text

‎ Flexibility ‎ Readability ‎ Portability ‎ Performance WHY A CUSTOM PLUGIN

Slide 23

Slide 23 text

‎ Flexibility ‎ Readability ‎ Portability ‎ Performance WHY A CUSTOM PLUGIN

Slide 24

Slide 24 text

‎ Flexibility ‎ Readability ‎ Portability ‎ Performance WHY A CUSTOM PLUGIN

Slide 25

Slide 25 text

‎ Flexibility ‎ Readability ‎ Portability ‎ Performance WHY A CUSTOM PLUGIN

Slide 26

Slide 26 text

GREAT, BUT WHAT CAN YOU DO WITH IT?

Slide 27

Slide 27 text

Duke Admissions CREDITS

Slide 28

Slide 28 text

Kettler Property Management CREDITS

Slide 29

Slide 29 text

Rumble Games CREDITS

Slide 30

Slide 30 text

  GETTING STARTED

Slide 31

Slide 31 text

BREAKING DOWN THE TEMPLATE TAG

Slide 32

Slide 32 text

{exp:eeci:present style=”keynote” parse=”inward”} Just a little presentation about plugins {/exp:eeci:present}

Slide 33

Slide 33 text

{exp:eeci:present style=”keynote” parse=”inward”} Just a little presentation about plugins {/exp:eeci:present}

Slide 34

Slide 34 text

{exp:eeci:present style=”keynote” parse=”inward”} Just a little presentation about plugins {/exp:eeci:present}

Slide 35

Slide 35 text

{exp:eeci:present style=”keynote” parse=”inward”} Just a little presentation about plugins {/exp:eeci:present}

Slide 36

Slide 36 text

{exp:eeci:present style=”keynote” parse=”inward”} Just a little presentation about plugins {/exp:eeci:present}

Slide 37

Slide 37 text

{exp:eeci:present style=”keynote” parse=”inward”} Just a little presentation about plugins {/exp:eeci:present}

Slide 38

Slide 38 text

{exp:eeci:present style=”keynote” parse=”inward”} Just a little presentation about plugins {/exp:eeci:present}

Slide 39

Slide 39 text

{exp:eeci:present style=”keynote” parse=”inward”} Just a little presentation about plugins {/exp:eeci:present}

Slide 40

Slide 40 text

{exp:eeci:present style=”keynote” parse=”inward”} Just a little presentation about {presentation_title} {/exp:eeci:present}

Slide 41

Slide 41 text

{exp:ce_img:pair src=”{your_custom_field}”} {/exp:ce_img:pair}

Slide 42

Slide 42 text

  GETTING IT WRITTEN

Slide 43

Slide 43 text

expressionengine.com/user_guide/development/ CREDITS

Slide 44

Slide 44 text

expressionengine.com/user_guide/development/plugins.html CREDITS

Slide 45

Slide 45 text

http://expressionengine.com/user_guide/development/guidelines/general.html CREDITS

Slide 46

Slide 46 text

pkg.io CREDITS

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

THE SIMPLEST OF PLUGINS

Slide 53

Slide 53 text

{exp:eeci_demo}

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

PLUGIN METHODS

Slide 57

Slide 57 text

{exp:eeci_demo:say} {exp:eeci_demo:shout}

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

PASSING PARAMETERS

Slide 61

Slide 61 text

{exp:eeci_demo:say message="Parameters are fun!"}

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

TAG PAIRS

Slide 65

Slide 65 text

{exp:eeci_demo:shout} Tag pairs aren't bad either {/exp:eeci_demo:shout}

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

COMPLEX OUTPUT

Slide 69

Slide 69 text

{exp:eeci_demo:feed_info}

{title}

{publish_date}

{content} {/exp:eeci_demo:feed_info}

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

{exp:eeci_demo:feed_info}

{title}

    {authors}
  • {name}
  • {/authors}

{publish_date}

{content} {/exp:eeci_demo:feed_info}

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

No content

Slide 77

Slide 77 text

{exp:eeci_demo:feed_info}
    {authors}
  • {name}

    {tags} {tagname} {/tags}

  • {/authors}
{/exp:eeci_demo:feed_info}

Slide 78

Slide 78 text

{exp:eeci_demo:feed_info}
    {authors}
  • {name}

    {tags} {tagname} {/tags}

  • {/authors}
{/exp:eeci_demo:feed_info}

Slide 79

Slide 79 text

FIXING THE PARSE ORDER

Slide 80

Slide 80 text

No content

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

{exp:eeci_demo:feed_info} {count} {total_results} {switch=”one|two|three”} {/exp:eeci_demo:feed_info}

Slide 84

Slide 84 text

Questions so far?

Slide 85

Slide 85 text

  STEPPING UP YOUR GAME

Slide 86

Slide 86 text

‎ Project Specific ‎ Abstracted and Stand-Alone PLUGIN ORGANIZATION

Slide 87

Slide 87 text

‎ Project Specific ‎ Abstracted and Stand-Alone PLUGIN ORGANIZATION

Slide 88

Slide 88 text

BUILT-IN EE CLASSES

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

No content

Slide 95

Slide 95 text

exp_channels exp_channel_titles exp_channel_data exp_categories exp_category_posts exp_relationships (exp_playa_relationships)

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

‎ CP ‎ Email ‎ File Field ‎ Form Validation ‎ Input ‎ Language ‎ Layout A WHOLE BUNCH MORE ‎ Localization ‎ Logger ‎ Security ‎ Table ‎ Typography ‎ URI ‎ XML Parser

Slide 99

Slide 99 text

TAPPING INTO OTHER ADD-ONS

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

Duke Admissions CREDITS

Slide 102

Slide 102 text

No content

Slide 103

Slide 103 text

THE CI IN EECI

Slide 104

Slide 104 text

THE CI IN EECI

Slide 105

Slide 105 text

‎ Benchmarking ‎ Calendar ‎ Encryption ‎ Image Manipulation ‎ XML-RPC ‎ Zip Encoding ‎ tons more... CODEIGNITER LIBRARIES/CLASSES

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

{if “{exp:eeci_demo:is_mobile}” == "true"} You're on a mobile device. {if:else} No mobile for you! {/i }

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

‎ Array ‎ Cookie ‎ Date ‎ Number ‎ Path ‎ URL ‎ tons more... CODEIGNITER HELPERS

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

{exp:eeci_demo:inflector text="dogs" method="singluar"} {exp:eeci_demo:inflector text="cat" method="plural"} {exp:eeci_demo:inflector text="maybe something to camel case" method="camel"} {exp:eeci_demo:inflector text="Combine to a single word" method="underscore"} {exp:eeci_demo:inflector text="maybe_a_url_title" method="human"}

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

codeigniter.com/user_guide/ CREDITS

Slide 114

Slide 114 text

WHERE TO NOW?

Slide 115

Slide 115 text

Thanks! @markupboy [email protected] markupboy.com