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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
100
Intro to I18N in code
mattheu
0
99
Tips for writing secure code in WordPress
mattheu
1
140
Other Decks in Programming
See All in Programming
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.6k
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
270
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
320
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.7k
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
110
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
8.5k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.6k
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
230
はてなアカウント基盤 State of the Union
cockscomb
1
1.2k
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
460
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.6k
Webフレームワークの ベンチマークについて
yusukebe
0
190
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
0
9.5k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
460
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
380
Statistics for Hackers
jakevdp
799
230k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Building an army of robots
kneath
306
46k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Exploring anti-patterns in Rails
aemeredith
3
430
A Tale of Four Properties
chriscoyier
163
24k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
230
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