Writing Your First Plugin

1,627 views

Published on

An introduction to writing your first plugin in ExpressionEngine

Published in: Technology, Art & Photos
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,627
On SlideShare
0
From Embeds
0
Number of Embeds
728
Actions
Shares
0
Downloads
16
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Writing Your First Plugin

    1. 1. Writing your first EE Plugin George Ornbo shapeshed.com @shapeshed
    2. 2. Hello! • London-based • EE Pro Network • github.com/shapeshed
    3. 3. Don’t miss this http://net.tutsplus.com/tutorials/ cmss/building-your-first- expressionengine-plugin/
    4. 4. Plugins, Extensions Modules. WTF? • Plugins are simple run-time enhancements • Extensions extend core functionality • Modules interact with a database and generally have a control panel
    5. 5. Starting out • Basic PHP • Understanding of templates and tags • Willpower
    6. 6. Mummy! • It is not as hard as it seems • There’s help available in the forums • It greatly enhances your offering as a developer
    7. 7. Plugins solve small problems • Client: I want all the titles on the site to have the first letter of each word capitalised • You: Can’t the editors fix that? • Client: There are 2000 articles. • You: OK Big Boy. Time for a plugin.
    8. 8. A typical weblog loop
    9. 9. Plugin setup
    10. 10. Naming the bits • The filename for a plugin should pi.class_name.php (all lowercase) • The class should be Class_name (first word uppercase only) • The function should match the Class name exactly
    11. 11. Adding plugin info
    12. 12. Add usage info
    13. 13. Add to /system/plugins/
    14. 14. It is easy to get this wrong • The plugin may not show up in the control panel • The plugin page in your control panel may error • You may get no output from your plugin
    15. 15. Do the magic
    16. 16. Add to your template
    17. 17. What this does • Takes the the input from the title tag • Sends it to the plugin • The plugin makes the first letter of each word uppercase • This is returned and displayed by the template • e.g. “My article title” becomes “My Article Title”
    18. 18. Job done.
    19. 19. What about EE 2.0? • Built on CodeIgniter • Plugins need to be ported • Generally not that difficult • CodeIgniter brings a lot of libraries and good things
    20. 20. Porting to EE 2.0
    21. 21. Other changes • Upload to /system/expressionengine/ thirdparty/pluginname/ • Weblogs are channels • Global classes are replaced by the EE Super Object $this->EE =& get_instance();
    22. 22. LE FIN • Slides and example plugin available at shapeshed.com/talks • Photos Creative Commons Licensed from Flickr: radville, its*me*red, craigmdennis, bfick

    ×