SlideShare a Scribd company logo
1 of 18
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

What's hot

Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sites
joelabrahamsson
 
Pluggable patterns
Pluggable patternsPluggable patterns
Pluggable patterns
Corey Oordt
 

What's hot (20)

Django
DjangoDjango
Django
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
CodeIgniter 101 Tutorial
CodeIgniter 101 TutorialCodeIgniter 101 Tutorial
CodeIgniter 101 Tutorial
 
Dicoding Developer Coaching #37: Android | Kesalahan yang Sering Terjadi pada...
Dicoding Developer Coaching #37: Android | Kesalahan yang Sering Terjadi pada...Dicoding Developer Coaching #37: Android | Kesalahan yang Sering Terjadi pada...
Dicoding Developer Coaching #37: Android | Kesalahan yang Sering Terjadi pada...
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
 
Benefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkBenefits of the CodeIgniter Framework
Benefits of the CodeIgniter Framework
 
Getting started with angular js
Getting started with angular jsGetting started with angular js
Getting started with angular js
 
Templates, partials and layouts
Templates, partials and layoutsTemplates, partials and layouts
Templates, partials and layouts
 
BDD, Behat & Drupal
BDD, Behat & DrupalBDD, Behat & Drupal
BDD, Behat & Drupal
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
 
5 angularjs features
5 angularjs features5 angularjs features
5 angularjs features
 
Fame
FameFame
Fame
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sites
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentation
 
EPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & TricksEPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & Tricks
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
 
Pluggable patterns
Pluggable patternsPluggable patterns
Pluggable patterns
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
 
Intro to html5 Boilerplate
Intro to html5 BoilerplateIntro to html5 Boilerplate
Intro to html5 Boilerplate
 
More object oriented development with Page Type Builder
More object oriented development with Page Type BuilderMore object oriented development with Page Type Builder
More object oriented development with Page Type Builder
 

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

Jquery Plugin
Jquery PluginJquery Plugin
Jquery Plugin
Ravi Mone
 
02 servlet-basics
02 servlet-basics02 servlet-basics
02 servlet-basics
snopteck
 
Chapter1pp
Chapter1ppChapter1pp
Chapter1pp
J. C.
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docx
danhaley45372
 
Ajax Tags Advanced
Ajax Tags AdvancedAjax Tags Advanced
Ajax Tags Advanced
AkramWaseem
 
Object-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfObject-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdf
Bharath Choudhary
 

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

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

More from Condiminds

'Not a developer? not a problem!' Brett Profitt #ECSF
'Not a developer? not a problem!' Brett Profitt #ECSF'Not a developer? not a problem!' Brett Profitt #ECSF
'Not a developer? not a problem!' Brett Profitt #ECSF
Condiminds
 
'State of Elgg' Brett Profitt #ECSF
'State of Elgg' Brett Profitt #ECSF'State of Elgg' Brett Profitt #ECSF
'State of Elgg' Brett Profitt #ECSF
Condiminds
 
'ElggCampSF Intro' Brett Profitt #ECSF
'ElggCampSF Intro' Brett Profitt #ECSF'ElggCampSF Intro' Brett Profitt #ECSF
'ElggCampSF Intro' Brett Profitt #ECSF
Condiminds
 
'Finding Baby Bear's Bed: a tale of two spaces' Jon Dron #ECSF
'Finding Baby Bear's Bed: a tale of two spaces' Jon Dron #ECSF'Finding Baby Bear's Bed: a tale of two spaces' Jon Dron #ECSF
'Finding Baby Bear's Bed: a tale of two spaces' Jon Dron #ECSF
Condiminds
 
'Elgg email integration' Mike Jett #ECSF
'Elgg email integration' Mike Jett #ECSF'Elgg email integration' Mike Jett #ECSF
'Elgg email integration' Mike Jett #ECSF
Condiminds
 
'Elgg in Education: Stanford University' David Adams #ECSF
'Elgg in Education: Stanford University' David Adams #ECSF'Elgg in Education: Stanford University' David Adams #ECSF
'Elgg in Education: Stanford University' David Adams #ECSF
Condiminds
 

More from Condiminds (15)

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

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Recently uploaded (20)

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 

'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