take control of your wordpress widgets
DESCRIPTION
Kaspars Dambis held this presentation at WorCamp Norway 2013. Kaspar Dambis is a Latvian working at Metronet in Oslo. He is the creator of the popular Widget Context plugin. He blogs about WordPress at konstruktors.com and be found on Twitter at @konstruktors.TRANSCRIPT
![Page 1: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/1.jpg)
Take Control of Your Widgets
Kaspars Dambiskonstruktors.com
@konstruktors
WordCamp Norway 2013
![Page 2: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/2.jpg)
Who is this guy?
![Page 3: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/3.jpg)
Latvian Champion in Autocross, 2007
![Page 4: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/4.jpg)
World's first electric race car to finish Dakar rally in 2012
![Page 5: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/5.jpg)
![Page 6: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/6.jpg)
![Page 7: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/7.jpg)
In ❤ since 2007
![Page 8: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/8.jpg)
![Page 9: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/9.jpg)
Custom Function Widgets
![Page 10: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/10.jpg)
Custom Function Widgets
![Page 11: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/11.jpg)
Widget ContextVersion 0.1
![Page 12: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/12.jpg)
A Sidebar?
![Page 13: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/13.jpg)
Sidebar "Minima" for Blogger
![Page 14: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/14.jpg)
Sidebar "Cubric" in WordPress 1.5 (2005)
![Page 15: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/15.jpg)
Sidebar "Twenty Twelve" in WordPress (2012)
![Page 16: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/16.jpg)
Sidebars are for related content
![Page 17: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/17.jpg)
Widgets in CoreWidgets were first provided by a plugin.
Available in core since WP 2.2 (May 16, 2007).
![Page 18: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/18.jpg)
Widgets in CoreAvailable in core since WP 2.2 (May 16, 2007).
![Page 19: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/19.jpg)
Problems
1. Widgets are not attached to the content
2. Widgets can't be edited in context
BUT
Widgets provide flexibility
![Page 20: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/20.jpg)
But Context Matters
![Page 21: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/21.jpg)
Solutions
1. Use multiple widget areas (sidebars) and templates to control their appearance
2. Use a plugin
![Page 22: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/22.jpg)
Solutions
1. Use multiple widget areas (sidebars) and templates to control their appearance
2. Use a plugin
![Page 23: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/23.jpg)
Need to know Template Tags (can't give to clients)
Uses evil() eval();
Widget Logic
![Page 24: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/24.jpg)
WooSidebarsSidebars as a custom post type.
Sidebars in context.
![Page 25: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/25.jpg)
Creates a lot of widget areas with custom visibility rules which are defined in another section of the WordPress dashboard.
WooSidebars
![Page 26: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/26.jpg)
Display WidgetsAdds context UI to widget settings.
![Page 27: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/27.jpg)
Individual posts and pages can be targeted only by URL patterns, which are hard to understand.
Widget ContextAdds context UI to widget settings.
![Page 28: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/28.jpg)
Problems
1. Widgets can't be edited on per-page basis.
2. Widgets can't be re-ordered on per-page basis
![Page 29: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/29.jpg)
Widget ContextExperiments
![Page 30: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/30.jpg)
Concept ABring Widget UI into Page Edit Screen
![Page 31: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/31.jpg)
Features:Per-page settings;Re-order widgets.
Problems:Adding and hiding new widgets requires editing all pages
Concept A
![Page 32: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/32.jpg)
Concept A Demo
![Page 33: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/33.jpg)
Simple Show/Hide option with a list of available rules.
Concept B
![Page 34: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/34.jpg)
Concept B Demo
![Page 35: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/35.jpg)
Concept C
![Page 36: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/36.jpg)
Concept C Demo
![Page 37: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/37.jpg)
Conclusions
1. Current setup (Sidebar UI) doesn't allow granular widget control.
2. Granular setup (Post Edit UI) is hard to manage on large scale sites.
![Page 38: Take Control of Your Wordpress Widgets](https://reader036.vdocument.in/reader036/viewer/2022081401/55910b511a28aba2548b469d/html5/thumbnails/38.jpg)
konstruktors.com@konstruktors
github.com/kasparsd