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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
240
WordPress REST API - Writing Custom Endpoints
mattheu
0
95
Intro to I18N in code
mattheu
0
86
Tips for writing secure code in WordPress
mattheu
1
140
Other Decks in Programming
See All in Programming
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
330
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
440
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
180
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.5k
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
270
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
360
文字コードの話
qnighy
44
17k
ロボットのための工場に灯りは要らない
watany
10
2.7k
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
130
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
840
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
5
900
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
710
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.4k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
820
Making Projects Easy
brettharned
120
6.6k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
380
Leo the Paperboy
mayatellez
4
1.5k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
170
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
200
Test your architecture with Archunit
thirion
1
2.2k
GraphQLとの向き合い方2022年版
quramy
50
14k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
280
Large-scale JavaScript Application Architecture
addyosmani
515
110k
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