SlideShare a Scribd company logo
1 of 31
Download to read offline
JLayout..
for extension developers
Start using future Joomla renderer today
Dedicated to Manuel Rubio
● Died 15th May 2015
● Opensource lover
● Joomla spanish magazine contributor
● Spanish translator / coordinator
● JUG Barcelona member
@mannuelru
About me
● PHP / Javascript Freelance
● PHP developer since 2010
● Joomla! lover & contributor since 2011
● Top 25 Joomla CMS contributors
● Opensource lover
● Linux user
● Git for everything
● Gulp all the things
@phproberto
¿What is JLayout?
● Rendering system
● Contributed by Yannick Gaultier
● Initially created to render sidebar
● A renderer that is now better than a
lot of other existing renderers
● The future of Joomla!
● Long way to walk
What can I use JLayout for?
● Render modules
● Render plugins
● Render component views
● Render fields
● Render anything!
Where can I find it?
JLayout include paths
Enable debug mode to see where your
layout is being loaded from
JLayout supports overriding by default
JLayout advantages
● Used in core
● Reusability
● Overridable
● Data / View separation
● Debuggable
● Data & layouts inheritance
● Cacheable
● Extensible
How is JLayout helping core?
● Remove dependencies (Mootools, Bootstrap2)
● Customise all the markup
● Custom modals
● Follow best practices
● Replaceable renderer
● Extension customisations
How is it used?
Layout to render
Example: article.tags
Layout Data
Example: array(‘article’ => $item)
Layouts base path
Example: JPATH_SITE .
/plugins/content/myplugin/layouts’
Options
Example: array(‘debug’ => true)
Complex usage
What should I use?
● In classes instances
● In layouts helpers
Handy PHP functions: extract()
Avoid things like:
$displayData[‘view’]->doSomething();
Handy PHP functions: compact()
Best practices
● Always pass data to layouts as an array
● Send only required data
● Use global debug mode
● Divide layouts in smaller parts
○ article
○ article.title
○ article.description.introtext
Best practices: Think JLayout
● An article can be shown in a module like in a view.
● Form layouts can be shared in front & backend
● An article slider can be shown in a category and in
a module.
● Same markup can be styled differently depending
in container.
○ <div class=”article-box”>
■ <h2 class=”article-title”>Joomla!</h2>
Best practices: Comment layout vars
Templaters don’t know the logic behind your app!
Best practices: Extend JLayout
Not for templaters!
Best practices: Extend JLayout (II)
Helper will use our own renderer
Best practices: getRenderer()
Best practices: getLayoutPaths()
Best practices: getLayoutData()
Best practices: getLayoutData() II
Extending data
JLayout for fields
Fields can use a different layout in form settings
Same field logic used to render things differently, add JS
libraries, etc.
JLayout for fields II
Try to use your own prefix
JLayout for libraries
● If it outputs HTML it has to be overridable
● If it loads assets templaters need to control it
JLayout with AJAX
● Return rendered information
● Load more items in a module
with lazyload / button click
● Change grid / list view
● Display forms where needed
JLayout with AJAX: Example
JLayout for templates
● Same markup. Your standard?
● Your layouts can be used in
multiple overrides without
changing them.
● Forms wherever you need them
● Layouts for different frameworks
JLayout for modules
● Debug switcher
● Module layouts inheritance
● Live module layout switcher with
com_ajax + JLayout
● AJAX to load more slider images
JLayout for plugins
● Debug switcher
● Finally your plugin is overridable
● Plugins can be shown differently
in different components.
● Plugins can reuse base component
layouts to render articles,etc.
That’s all!
Questions?

More Related Content

What's hot

Bloc TechTalk - How to Setup Your Android Development Environment
Bloc TechTalk - How to Setup Your Android Development EnvironmentBloc TechTalk - How to Setup Your Android Development Environment
Bloc TechTalk - How to Setup Your Android Development EnvironmentPrasid Pathak
 
Moodley Session #02 - pattern libraries
Moodley Session #02 - pattern librariesMoodley Session #02 - pattern libraries
Moodley Session #02 - pattern librariesmariosom
 
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Luis Rivera
 
[NijmegenJS] Node.js - 2014/04/25
[NijmegenJS] Node.js - 2014/04/25[NijmegenJS] Node.js - 2014/04/25
[NijmegenJS] Node.js - 2014/04/25jvdheijden
 
Can android be an http server
Can android be an http server Can android be an http server
Can android be an http server 中條 剛
 
Webdev bootcamp
Webdev bootcampWebdev bootcamp
Webdev bootcampDSCMESCOE
 
Introduction to Google Web Toolkit - part 1
Introduction to Google Web Toolkit - part 1Introduction to Google Web Toolkit - part 1
Introduction to Google Web Toolkit - part 1Muhammad Ghazali
 
Configure python and wsgi
Configure python and wsgiConfigure python and wsgi
Configure python and wsgiSitthykun LY
 
(some) Drupal Theming by Ryan Price
(some) Drupal Theming by Ryan Price(some) Drupal Theming by Ryan Price
(some) Drupal Theming by Ryan PriceRyan Price
 
Using twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensionsUsing twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensionsRoberto Segura
 
Master your debugger
Master your debuggerMaster your debugger
Master your debuggerPaul Comanici
 
Teach yourself Ruby on Rails
Teach yourself Ruby on RailsTeach yourself Ruby on Rails
Teach yourself Ruby on Railspatrikbona
 
GDG Varna - When Android Meets Maps
GDG Varna - When Android Meets MapsGDG Varna - When Android Meets Maps
GDG Varna - When Android Meets MapsDimitar Danailov
 
Translating Fedora Documentation: Indonesian Team Perspective
Translating Fedora Documentation: Indonesian Team PerspectiveTranslating Fedora Documentation: Indonesian Team Perspective
Translating Fedora Documentation: Indonesian Team PerspectiveAndika Triwidada
 
Plugins on word press
Plugins on word pressPlugins on word press
Plugins on word pressKoombea
 

What's hot (19)

Bloc TechTalk - How to Setup Your Android Development Environment
Bloc TechTalk - How to Setup Your Android Development EnvironmentBloc TechTalk - How to Setup Your Android Development Environment
Bloc TechTalk - How to Setup Your Android Development Environment
 
Moodley Session #02 - pattern libraries
Moodley Session #02 - pattern librariesMoodley Session #02 - pattern libraries
Moodley Session #02 - pattern libraries
 
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
Tetuan Valley Startup School - Guest mentor Angel Luis Quesada (Kubide)
 
[NijmegenJS] Node.js - 2014/04/25
[NijmegenJS] Node.js - 2014/04/25[NijmegenJS] Node.js - 2014/04/25
[NijmegenJS] Node.js - 2014/04/25
 
Scrum introduction
Scrum introductionScrum introduction
Scrum introduction
 
Git intro fajar muslim
Git intro fajar muslimGit intro fajar muslim
Git intro fajar muslim
 
Can android be an http server
Can android be an http server Can android be an http server
Can android be an http server
 
Webdev bootcamp
Webdev bootcampWebdev bootcamp
Webdev bootcamp
 
Introduction to Google Web Toolkit - part 1
Introduction to Google Web Toolkit - part 1Introduction to Google Web Toolkit - part 1
Introduction to Google Web Toolkit - part 1
 
Configure python and wsgi
Configure python and wsgiConfigure python and wsgi
Configure python and wsgi
 
(some) Drupal Theming by Ryan Price
(some) Drupal Theming by Ryan Price(some) Drupal Theming by Ryan Price
(some) Drupal Theming by Ryan Price
 
Using twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensionsUsing twig as rendering system for your Joomla extensions
Using twig as rendering system for your Joomla extensions
 
Master your debugger
Master your debuggerMaster your debugger
Master your debugger
 
Teach yourself Ruby on Rails
Teach yourself Ruby on RailsTeach yourself Ruby on Rails
Teach yourself Ruby on Rails
 
RealDay: Angular.js
RealDay: Angular.jsRealDay: Angular.js
RealDay: Angular.js
 
GDG Varna - When Android Meets Maps
GDG Varna - When Android Meets MapsGDG Varna - When Android Meets Maps
GDG Varna - When Android Meets Maps
 
TypeScript
TypeScriptTypeScript
TypeScript
 
Translating Fedora Documentation: Indonesian Team Perspective
Translating Fedora Documentation: Indonesian Team PerspectiveTranslating Fedora Documentation: Indonesian Team Perspective
Translating Fedora Documentation: Indonesian Team Perspective
 
Plugins on word press
Plugins on word pressPlugins on word press
Plugins on word press
 

Similar to JLayout for extension developers

Hong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8thHong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8thWong Hoi Sing Edison
 
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesSpeedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesAcquia
 
Contributions: what they are and how to find them
Contributions: what they are and how to find themContributions: what they are and how to find them
Contributions: what they are and how to find themPedro Cambra
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master BuilderPhilip Norton
 
Drupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 monthsDrupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 monthsIztok Smolic
 
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...DevDay.org
 
The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8Acquia
 
Android Modularization
Android ModularizationAndroid Modularization
Android ModularizationYoung-Hyuk Yoo
 
FRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and PatternsFRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and PatternsLeapfrog Technology Inc.
 
Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Peter Martin
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyMarcos Labad
 
JUG Utrecht 2013 - Have you tried turning it off and on again? Problemen oplo...
JUG Utrecht 2013 - Have you tried turning it off and on again? Problemen oplo...JUG Utrecht 2013 - Have you tried turning it off and on again? Problemen oplo...
JUG Utrecht 2013 - Have you tried turning it off and on again? Problemen oplo...Peter Martin
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoKnoldus Inc.
 
Joomla! future #jd14fr keynote
Joomla! future #jd14fr keynoteJoomla! future #jd14fr keynote
Joomla! future #jd14fr keynoteRoberto Segura
 
Joomla! Templates and Comparison of Frameworks
Joomla! Templates and Comparison of FrameworksJoomla! Templates and Comparison of Frameworks
Joomla! Templates and Comparison of FrameworksSaurabh Shah
 
Decoupled drupal + vue.js
Decoupled drupal + vue.jsDecoupled drupal + vue.js
Decoupled drupal + vue.jsEugene Vozniuk
 
UX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATIONUX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATIONDrupalCamp Kyiv
 
Boltc CMS - a really quick overview
Boltc CMS - a really quick overviewBoltc CMS - a really quick overview
Boltc CMS - a really quick overviewdantleech
 
Complexity Simplified? (Seblod CCK walk through)
Complexity Simplified? (Seblod CCK walk through)Complexity Simplified? (Seblod CCK walk through)
Complexity Simplified? (Seblod CCK walk through)Joomla Day South Africa
 

Similar to JLayout for extension developers (20)

Hong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8thHong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8th
 
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesSpeedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
 
Contributions: what they are and how to find them
Contributions: what they are and how to find themContributions: what they are and how to find them
Contributions: what they are and how to find them
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
Drupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 monthsDrupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 months
 
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
[DevDay2018] Liferay DXP – A powerful Enterprise Solution - By Vy Bui, Develo...
 
The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8The Workflow Methodology to Train Your Team on Drupal 8
The Workflow Methodology to Train Your Team on Drupal 8
 
Android Modularization
Android ModularizationAndroid Modularization
Android Modularization
 
FRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and PatternsFRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
 
Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014
 
Joomla - CMS
Joomla - CMSJoomla - CMS
Joomla - CMS
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
 
JUG Utrecht 2013 - Have you tried turning it off and on again? Problemen oplo...
JUG Utrecht 2013 - Have you tried turning it off and on again? Problemen oplo...JUG Utrecht 2013 - Have you tried turning it off and on again? Problemen oplo...
JUG Utrecht 2013 - Have you tried turning it off and on again? Problemen oplo...
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Joomla! future #jd14fr keynote
Joomla! future #jd14fr keynoteJoomla! future #jd14fr keynote
Joomla! future #jd14fr keynote
 
Joomla! Templates and Comparison of Frameworks
Joomla! Templates and Comparison of FrameworksJoomla! Templates and Comparison of Frameworks
Joomla! Templates and Comparison of Frameworks
 
Decoupled drupal + vue.js
Decoupled drupal + vue.jsDecoupled drupal + vue.js
Decoupled drupal + vue.js
 
UX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATIONUX DURING MODULE INSTALLATION AND CONFIGURATION
UX DURING MODULE INSTALLATION AND CONFIGURATION
 
Boltc CMS - a really quick overview
Boltc CMS - a really quick overviewBoltc CMS - a really quick overview
Boltc CMS - a really quick overview
 
Complexity Simplified? (Seblod CCK walk through)
Complexity Simplified? (Seblod CCK walk through)Complexity Simplified? (Seblod CCK walk through)
Complexity Simplified? (Seblod CCK walk through)
 

More from Roberto Segura

TDD for joomla extensions
TDD for joomla extensionsTDD for joomla extensions
TDD for joomla extensionsRoberto Segura
 
Joomla Entity - API semántica para Joomla
Joomla Entity - API semántica para JoomlaJoomla Entity - API semántica para Joomla
Joomla Entity - API semántica para JoomlaRoberto Segura
 
Uso de tecnologías modernas en joomla
Uso de tecnologías modernas en joomlaUso de tecnologías modernas en joomla
Uso de tecnologías modernas en joomlaRoberto Segura
 
Plugin para-joomla-45-minutos
Plugin para-joomla-45-minutosPlugin para-joomla-45-minutos
Plugin para-joomla-45-minutosRoberto Segura
 
Introducción a la programación para joomla
Introducción a la programación para joomlaIntroducción a la programación para joomla
Introducción a la programación para joomlaRoberto Segura
 
Git for joomla! development #JAB14
Git for joomla! development #JAB14Git for joomla! development #JAB14
Git for joomla! development #JAB14Roberto Segura
 
Introduccción a la programación en Joomla!
Introduccción a la programación en Joomla!Introduccción a la programación en Joomla!
Introduccción a la programación en Joomla!Roberto Segura
 

More from Roberto Segura (7)

TDD for joomla extensions
TDD for joomla extensionsTDD for joomla extensions
TDD for joomla extensions
 
Joomla Entity - API semántica para Joomla
Joomla Entity - API semántica para JoomlaJoomla Entity - API semántica para Joomla
Joomla Entity - API semántica para Joomla
 
Uso de tecnologías modernas en joomla
Uso de tecnologías modernas en joomlaUso de tecnologías modernas en joomla
Uso de tecnologías modernas en joomla
 
Plugin para-joomla-45-minutos
Plugin para-joomla-45-minutosPlugin para-joomla-45-minutos
Plugin para-joomla-45-minutos
 
Introducción a la programación para joomla
Introducción a la programación para joomlaIntroducción a la programación para joomla
Introducción a la programación para joomla
 
Git for joomla! development #JAB14
Git for joomla! development #JAB14Git for joomla! development #JAB14
Git for joomla! development #JAB14
 
Introduccción a la programación en Joomla!
Introduccción a la programación en Joomla!Introduccción a la programación en Joomla!
Introduccción a la programación en Joomla!
 

Recently uploaded

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROmotivationalword821
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 

Recently uploaded (20)

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 

JLayout for extension developers

  • 1. JLayout.. for extension developers Start using future Joomla renderer today
  • 2. Dedicated to Manuel Rubio ● Died 15th May 2015 ● Opensource lover ● Joomla spanish magazine contributor ● Spanish translator / coordinator ● JUG Barcelona member @mannuelru
  • 3. About me ● PHP / Javascript Freelance ● PHP developer since 2010 ● Joomla! lover & contributor since 2011 ● Top 25 Joomla CMS contributors ● Opensource lover ● Linux user ● Git for everything ● Gulp all the things @phproberto
  • 4. ¿What is JLayout? ● Rendering system ● Contributed by Yannick Gaultier ● Initially created to render sidebar ● A renderer that is now better than a lot of other existing renderers ● The future of Joomla! ● Long way to walk
  • 5. What can I use JLayout for? ● Render modules ● Render plugins ● Render component views ● Render fields ● Render anything!
  • 6. Where can I find it?
  • 7. JLayout include paths Enable debug mode to see where your layout is being loaded from JLayout supports overriding by default
  • 8. JLayout advantages ● Used in core ● Reusability ● Overridable ● Data / View separation ● Debuggable ● Data & layouts inheritance ● Cacheable ● Extensible
  • 9. How is JLayout helping core? ● Remove dependencies (Mootools, Bootstrap2) ● Customise all the markup ● Custom modals ● Follow best practices ● Replaceable renderer ● Extension customisations
  • 10. How is it used? Layout to render Example: article.tags Layout Data Example: array(‘article’ => $item) Layouts base path Example: JPATH_SITE . /plugins/content/myplugin/layouts’ Options Example: array(‘debug’ => true)
  • 11. Complex usage What should I use? ● In classes instances ● In layouts helpers
  • 12. Handy PHP functions: extract() Avoid things like: $displayData[‘view’]->doSomething();
  • 13. Handy PHP functions: compact()
  • 14. Best practices ● Always pass data to layouts as an array ● Send only required data ● Use global debug mode ● Divide layouts in smaller parts ○ article ○ article.title ○ article.description.introtext
  • 15. Best practices: Think JLayout ● An article can be shown in a module like in a view. ● Form layouts can be shared in front & backend ● An article slider can be shown in a category and in a module. ● Same markup can be styled differently depending in container. ○ <div class=”article-box”> ■ <h2 class=”article-title”>Joomla!</h2>
  • 16. Best practices: Comment layout vars Templaters don’t know the logic behind your app!
  • 17. Best practices: Extend JLayout Not for templaters!
  • 18. Best practices: Extend JLayout (II) Helper will use our own renderer
  • 22. Best practices: getLayoutData() II Extending data
  • 23. JLayout for fields Fields can use a different layout in form settings Same field logic used to render things differently, add JS libraries, etc.
  • 24. JLayout for fields II Try to use your own prefix
  • 25. JLayout for libraries ● If it outputs HTML it has to be overridable ● If it loads assets templaters need to control it
  • 26. JLayout with AJAX ● Return rendered information ● Load more items in a module with lazyload / button click ● Change grid / list view ● Display forms where needed
  • 28. JLayout for templates ● Same markup. Your standard? ● Your layouts can be used in multiple overrides without changing them. ● Forms wherever you need them ● Layouts for different frameworks
  • 29. JLayout for modules ● Debug switcher ● Module layouts inheritance ● Live module layout switcher with com_ajax + JLayout ● AJAX to load more slider images
  • 30. JLayout for plugins ● Debug switcher ● Finally your plugin is overridable ● Plugins can be shown differently in different components. ● Plugins can reuse base component layouts to render articles,etc.