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
220
WordPress REST API - Writing Custom Endpoints
mattheu
0
89
Intro to I18N in code
mattheu
0
79
Tips for writing secure code in WordPress
mattheu
1
130
Other Decks in Programming
See All in Programming
Deep Dive into ~/.claude/projects
hiragram
10
1.7k
エラーって何種類あるの?
kajitack
5
320
Is Xcode slowly dying out in 2025?
uetyo
1
210
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
180
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
2
290
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
400
技術同人誌をMCP Serverにしてみた
74th
1
430
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
150
GoのGenericsによるslice操作との付き合い方
syumai
3
690
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.4k
来たるべき 8.0 に備えて React 19 新機能と React Router 固有機能の取捨選択とすり合わせを考える
oukayuka
2
870
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
400
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Making Projects Easy
brettharned
116
6.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
KATA
mclloyd
30
14k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
How STYLIGHT went responsive
nonsquared
100
5.6k
Facilitating Awesome Meetings
lara
54
6.4k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
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