Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Making shortcodes a piece of cake
Search
Matthew Haines-Young
March 10, 2015
Programming
24k
0
Share
Making shortcodes a piece of cake
How we manage complex page elements
in WordPress with Shortcake on Fusion.net
Matthew Haines-Young
March 10, 2015
More Decks by Matthew Haines-Young
See All by Matthew Haines-Young
Building Sites with Gutenberg
mattheu
1
250
WordPress REST API - Writing Custom Endpoints
mattheu
0
95
Intro to I18N in code
mattheu
0
97
Tips for writing secure code in WordPress
mattheu
1
140
Other Decks in Programming
See All in Programming
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
170
横断組織出身のQAEがインプロセスQAEでつまずいたこと・活かせたこと
ty89
0
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
250
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
120
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
210
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
280
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
110
AgentCore Optimizationを始めよう!
licux
4
280
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
1.7k
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
120
20260514_its_the_context_window_stupid.pdf
heita
0
1.1k
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
120
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
140
The Language of Interfaces
destraynor
162
26k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
570
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
So, you think you're a good person
axbom
PRO
2
2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Leo the Paperboy
mayatellez
7
1.8k
エンジニアに許された特別な時間の終わり
watany
107
240k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Transcript
MAKING SHORTCODES A PIECE OF CAKE Manage complex page elements
in WordPress with Shortcake https://github.com/fusioneng/Shortcake
None
• US-based, multi-platform media company • Expanding their web presence
• Migrated Fusion.net to WordPress (end 2014) • Launched a big redesign (early 2015) • Want to publish great content on the web
AUTHORS NEED TO BUILD INTERESTING PAGES THEMSELVES ON A DAILY
BASIS
EXAMPLE: BLOCKQUOTE
GOALS • Simple and easy to use tool • No
code • WYSIWYG • Flexible, reusable modules • Simple for developers to add new modules • Make use of existing tools
None
None
None
None
None
None
HOW DO WE DO IT?
• Available in WordPress since 2.5 • WordPress uses them
for galleries, audio and video • Simple code: [name attr="value"] • Converted to HTML when output SHORTCODES
BUT EVERYBODY HATES SHORTCODES!
• Terrible user experience • Users still have to write
code • No discoverability • Poor documentation • Often don’t have previews WHY ARE SHORTCODES BAD?
SHORTCODE PREVIEWS • It is possible to get previews in
the editor • Easier now than it once was • MCE Views • Simple JavaScript API to register a preview for a shortcode
SHORTCAKE = SHORTCODES + MCE VIEWS + INTERFACE
• Mostly JavaScript - Backbone.js • Modules - Grunt +
Browserify • Jasmine for unit testing (Grunt, TravisCI) • PHP to generate preview - output exactly as on the front end TECHNICAL INFO
EXAMPLES FROM FUSION.NET
GALLERY
IMAGE COMPARISON
EMBEDDED PDF
• Interactives. JS apps & games • Liveblogs (WordPress VIP
Liveblogs) • Social Streams. Curated grid of content from Twitter, Instagram etc • Embedding third party content. (Quiz from Playbuzz) OTHER EXAMPLES
SHORTCAKE MAKES USING SHORTCODES A PIECE OF CAKE!
BUT ITS NOT REALLY ABOUT SHORTCODES
IF A USER EVER SEES A SHORTCODE, THEN
WE’VE FAILED
SHORTCAKE MAKES IT EASY TO ADD COMPLEX BLOCKS OF CONTENT