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
87
Tips for writing secure code in WordPress
mattheu
1
140
Other Decks in Programming
See All in Programming
個人的に嬉しかったpnpmの新機能・3選
matsuo_atsushi
0
100
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
1.8k
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
1.1k
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
4
1.3k
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
24
16k
第3木曜LT会 #28
tinykitten
PRO
0
120
tRPCの概要と少しだけパフォーマンス
misoton665
2
240
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
190
Swift Concurrency Type System
inamiy
1
560
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
300
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
160
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.3k
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Making Projects Easy
brettharned
120
6.6k
30 Presentation Tips
portentint
PRO
1
280
Ethics towards AI in product and experience design
skipperchong
2
260
Code Reviewing Like a Champion
maltzj
528
40k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
130
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
How to Ace a Technical Interview
jacobian
281
24k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
220
Speed Design
sergeychernyshev
33
1.6k
Amusing Abliteration
ianozsvald
1
160
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