$30 off During Our Annual Pro Sale. View Details »
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
0
24k
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
Tweet
Share
More Decks by Matthew Haines-Young
See All by Matthew Haines-Young
Building Sites with Gutenberg
mattheu
1
230
WordPress REST API - Writing Custom Endpoints
mattheu
0
94
Intro to I18N in code
mattheu
0
83
Tips for writing secure code in WordPress
mattheu
1
130
Other Decks in Programming
See All in Programming
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
590
AIと協働し、イベントソーシングとアクターモデルで作る後悔しないアーキテクチャ Regret-Free Architecture with AI, Event Sourcing, and Actors
tomohisa
5
15k
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
280
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
WebRTC と Rust と8K 60fps
tnoho
2
1.7k
テストやOSS開発に役立つSetup PHP Action
matsuo_atsushi
0
120
FluorTracer / RayTracingCamp11
kugimasa
0
150
Atomics APIを知る / Understanding Atomics API
ssssota
1
240
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
250
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
990
関数の挙動書き換える
takatofukui
4
760
jakarta-security-jjug-ccc-2025-fall
tnagao7
0
110
Featured
See All Featured
Side Projects
sachag
455
43k
Visualization
eitanlees
150
16k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
A Modern Web Designer's Workflow
chriscoyier
697
190k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Art, The Web, and Tiny UX
lynnandtonic
303
21k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
GraphQLとの向き合い方2022年版
quramy
49
14k
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