SlideShare a Scribd company logo
Best Practices for Elgg Plugin
        Developers

             Cash Costello
        ElggCamp San Francisco
Best Practices for Elgg Plugin
        Developers

             Cash Costello
        ElggCamp San Francisco
About Me
Elgg core developer
Author of Elgg Social Networking 1.8
Employed by Johns Hopkins University Applied
 Physics Laboratory (JHU/APL)
R&D in machine learning
Driving force behind JHU/APL's collaborative
 platform built on Elgg
1. Namespace your functions, classes, actions,
          views, CSS, JavaScript
2. Make dependencies between plugins explicit


 Plugin manifest, function_exists(), elgg_is_active_plugin()
3. Create a site customization plugin as a catch all
              for small modifications

   Maintain a readme with list of customizations!
4. Keep your plugin's start.php trim


elgg_register_library(), elgg_load_library(), class with static
  methods
5. Use inheritance with Elgg's data model


Remember to unregister your class when your plugin is disabled
 using the deactivate.php script with update_subtype()
6. Document what metadata is used with your
                 entities

@property in documentation of class or use getter/setter methods
7. Avoid using many metadata key-value pairs
           with elgg_get_entities*()
8. Use Elgg's functions and classes when
     interacting with the data model
9. Be aware that setting metadata on an entity
        clears Elgg's database cache
10. Use relationships to connect entities


Not metadata!
11. Do not create large views
12. Create views that correspond to visual
                 elements

Also look for common elements that can be reused
13. Use the core views and CSS classes
           whenever possible
14. Learn the principles behind Elgg's new HTML/
                       CSS

  Example: CSS selectors should not cross element boundaries
15. Test with non-admin user and while logged
                     out

More Related Content

PDF
ElggCamp Santiago - Dev Edition
PPTX
MVC Frameworks for building PHP Web Applications
PDF
Principles of MVC for PHP Developers
PDF
Introduction to Using PHP & MVC Frameworks
ODP
A Good PHP Framework For Beginners Like Me!
PPT
Introduction To Code Igniter
DOCX
10 reasons to choose CakePHP as Framework
PDF
Progressive EPiServer Development
ElggCamp Santiago - Dev Edition
MVC Frameworks for building PHP Web Applications
Principles of MVC for PHP Developers
Introduction to Using PHP & MVC Frameworks
A Good PHP Framework For Beginners Like Me!
Introduction To Code Igniter
10 reasons to choose CakePHP as Framework
Progressive EPiServer Development

What's hot (20)

PDF
PDF
Introduction To CodeIgniter
PPTX
CodeIgniter 101 Tutorial
PDF
Dicoding Developer Coaching #37: Android | Kesalahan yang Sering Terjadi pada...
PPTX
jQuery basics
PPT
Benefits of the CodeIgniter Framework
PPT
Getting started with angular js
PPTX
Templates, partials and layouts
PPTX
BDD, Behat & Drupal
PDF
AngularJS: Overview & Key Features
PPTX
5 angularjs features
PPTX
Automated Testing Of EPiServer CMS Sites
PPT
ASP.net MVC CodeCamp Presentation
PPTX
EPiServer Deployment Tips & Tricks
PPT
ASP .net MVC
PDF
Pluggable patterns
PDF
AngularJS - What is it & Why is it awesome ? (with demos)
KEY
Intro to html5 Boilerplate
PPTX
More object oriented development with Page Type Builder
Introduction To CodeIgniter
CodeIgniter 101 Tutorial
Dicoding Developer Coaching #37: Android | Kesalahan yang Sering Terjadi pada...
jQuery basics
Benefits of the CodeIgniter Framework
Getting started with angular js
Templates, partials and layouts
BDD, Behat & Drupal
AngularJS: Overview & Key Features
5 angularjs features
Automated Testing Of EPiServer CMS Sites
ASP.net MVC CodeCamp Presentation
EPiServer Deployment Tips & Tricks
ASP .net MVC
Pluggable patterns
AngularJS - What is it & Why is it awesome ? (with demos)
Intro to html5 Boilerplate
More object oriented development with Page Type Builder
Ad

Similar to 'Best Practices for Elgg Plugin Developers' Cash Costello #ECSF (20)

ODP
Jquery Plugin
PPS
Jump start to OOP, OOAD, and Design Pattern
PPT
Jump Start To Ooad And Design Patterns
PDF
02 servlet-basics
PPTX
Aem best practices
PDF
Mini-Training: Javascript Patterns
PDF
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6...
PPT
What is new in elgg 1.8?
ODP
Modular programming Using Object in Scala
PPT
Chapter1pp
DOCX
Notepad tutorial
DOCX
Patterns (contd)Software Development ProcessDesign patte.docx
PDF
React Best Practices All Developers Should Follow in 2024.pdf
PDF
ElggCamp Santiago> For Developers!
PDF
Ajax Tags Advanced
PDF
Deepak khetawat sling_models_sightly_jsp
PPTX
Eclipse 40 and Eclipse e4
ODP
Java 9 Features
PDF
Object-Oriented Programming in Java.pdf
PPTX
When Sightly Meets Slice by Tomasz Niedźwiedź
Jquery Plugin
Jump start to OOP, OOAD, and Design Pattern
Jump Start To Ooad And Design Patterns
02 servlet-basics
Aem best practices
Mini-Training: Javascript Patterns
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6...
What is new in elgg 1.8?
Modular programming Using Object in Scala
Chapter1pp
Notepad tutorial
Patterns (contd)Software Development ProcessDesign patte.docx
React Best Practices All Developers Should Follow in 2024.pdf
ElggCamp Santiago> For Developers!
Ajax Tags Advanced
Deepak khetawat sling_models_sightly_jsp
Eclipse 40 and Eclipse e4
Java 9 Features
Object-Oriented Programming in Java.pdf
When Sightly Meets Slice by Tomasz Niedźwiedź
Ad

More from Condiminds (15)

PDF
'Not a developer? not a problem!' Brett Profitt #ECSF
PDF
'State of Elgg' Brett Profitt #ECSF
PDF
'ElggCampSF Intro' Brett Profitt #ECSF
PDF
'Finding Baby Bear's Bed: a tale of two spaces' Jon Dron #ECSF
PDF
'Elgg email integration' Mike Jett #ECSF
ODP
'Elgg in Education: Stanford University' David Adams #ECSF
PDF
Introducción a las Metodologías Ágiles
PPTX
Querés hacer tu Caralibro? | Emilio Gonzalez | Condiminds
PPTX
10 Tips para una Red de Nicho | Condiminds
PPTX
Bienvenida ElggCampBA 2010
PDF
Social Enterprise Guru Device
PPT
Desarrollo de Redes Sociales para Social Enterprise, Powered by Elgg
PPTX
Elgg para Mkt online en el #barcampba
PDF
Elgg Camp Buenos Aires - English
PDF
Elgg Camp Buenos Aires - Español
'Not a developer? not a problem!' Brett Profitt #ECSF
'State of Elgg' Brett Profitt #ECSF
'ElggCampSF Intro' Brett Profitt #ECSF
'Finding Baby Bear's Bed: a tale of two spaces' Jon Dron #ECSF
'Elgg email integration' Mike Jett #ECSF
'Elgg in Education: Stanford University' David Adams #ECSF
Introducción a las Metodologías Ágiles
Querés hacer tu Caralibro? | Emilio Gonzalez | Condiminds
10 Tips para una Red de Nicho | Condiminds
Bienvenida ElggCampBA 2010
Social Enterprise Guru Device
Desarrollo de Redes Sociales para Social Enterprise, Powered by Elgg
Elgg para Mkt online en el #barcampba
Elgg Camp Buenos Aires - English
Elgg Camp Buenos Aires - Español

Recently uploaded (20)

PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Institutional Correction lecture only . . .
PPTX
Cell Types and Its function , kingdom of life
PPTX
master seminar digital applications in india
PDF
Complications of Minimal Access Surgery at WLH
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Lesson notes of climatology university.
PPTX
Presentation on HIE in infants and its manifestations
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
GDM (1) (1).pptx small presentation for students
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Chinmaya Tiranga quiz Grand Finale.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Institutional Correction lecture only . . .
Cell Types and Its function , kingdom of life
master seminar digital applications in india
Complications of Minimal Access Surgery at WLH
2.FourierTransform-ShortQuestionswithAnswers.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Lesson notes of climatology university.
Presentation on HIE in infants and its manifestations
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
GDM (1) (1).pptx small presentation for students
STATICS OF THE RIGID BODIES Hibbelers.pdf
Pharma ospi slides which help in ospi learning
Final Presentation General Medicine 03-08-2024.pptx
Supply Chain Operations Speaking Notes -ICLT Program
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape

'Best Practices for Elgg Plugin Developers' Cash Costello #ECSF

  • 1. Best Practices for Elgg Plugin Developers Cash Costello ElggCamp San Francisco
  • 2. Best Practices for Elgg Plugin Developers Cash Costello ElggCamp San Francisco
  • 3. About Me Elgg core developer Author of Elgg Social Networking 1.8 Employed by Johns Hopkins University Applied Physics Laboratory (JHU/APL) R&D in machine learning Driving force behind JHU/APL's collaborative platform built on Elgg
  • 4. 1. Namespace your functions, classes, actions, views, CSS, JavaScript
  • 5. 2. Make dependencies between plugins explicit Plugin manifest, function_exists(), elgg_is_active_plugin()
  • 6. 3. Create a site customization plugin as a catch all for small modifications Maintain a readme with list of customizations!
  • 7. 4. Keep your plugin's start.php trim elgg_register_library(), elgg_load_library(), class with static methods
  • 8. 5. Use inheritance with Elgg's data model Remember to unregister your class when your plugin is disabled using the deactivate.php script with update_subtype()
  • 9. 6. Document what metadata is used with your entities @property in documentation of class or use getter/setter methods
  • 10. 7. Avoid using many metadata key-value pairs with elgg_get_entities*()
  • 11. 8. Use Elgg's functions and classes when interacting with the data model
  • 12. 9. Be aware that setting metadata on an entity clears Elgg's database cache
  • 13. 10. Use relationships to connect entities Not metadata!
  • 14. 11. Do not create large views
  • 15. 12. Create views that correspond to visual elements Also look for common elements that can be reused
  • 16. 13. Use the core views and CSS classes whenever possible
  • 17. 14. Learn the principles behind Elgg's new HTML/ CSS Example: CSS selectors should not cross element boundaries
  • 18. 15. Test with non-admin user and while logged out