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
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
91
Intro to I18N in code
mattheu
0
81
Tips for writing secure code in WordPress
mattheu
1
130
Other Decks in Programming
See All in Programming
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
14
47k
エンジニアインターン「Treasure」とHonoの2年、そして未来へ / Our Journey with Hono Two Years at Treasure and Beyond
carta_engineering
0
470
マンガアプリViewerの大画面対応を考える
kk__777
0
440
品質ワークショップをやってみた
nealle
0
830
Reactive Thinking with Signals and the Resource API
manfredsteyer
PRO
0
120
Designing Repeatable Edits: The Architecture of . in Vim
satorunooshie
0
210
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
200
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
120
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.9k
CSC305 Lecture 12
javiergs
PRO
0
250
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
120
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
490
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
650
Optimizing for Happiness
mojombo
379
70k
Speed Design
sergeychernyshev
32
1.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
900
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.7k
GraphQLとの向き合い方2022年版
quramy
49
14k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Rails Girls Zürich Keynote
gr2m
95
14k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
680
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
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