SlideShare ist ein Scribd-Unternehmen logo
1 von 53
Downloaden Sie, um offline zu lesen
SILVERSTRIPE MODULES
FOR A BETTER LIFE
“Bigfork are second-to-none at taking our InDesign files
and recreating them in a content-managed website using
SilverStripe.
The CMS is very simple to use – allowing us and our
clients to update websites quickly and easily.”
BOOTSTRAP
$ git clone https://github.com/feejin/Silverstripe-CleanInstall.git
$ cd my-project
$ composer install
COMPOSER.JSON
{
"require": {
"silverstripe/cms": "~3.1.15",
"silverstripe/framework": "~3.1.15",
…
},
"autoload": { "psr-4": { "Bigfork": "util/Bigfork" } },
"scripts": {
"post-install-cmd": "BigforkInstallerInstall::postInstall",
"post-update-cmd": "BigforkInstallerInstall::postUpdate"
}
}
FRONT-END MODULES
MENU MANAGER
"heyday/silverstripe-menumanager"
<% loop $MenuSet('MyMenu').MenuItems %>
<li><a href="$Link" class="$LinkingMode">$MenuTitle</a></li>
<% end_loop %>
EXAMPLES
› Auxiliary Links
› Footer Links
› Navigation Menu
RESPONSIVE IMAGES
"heyday/silverstripe-responsive-images"
PICTUREFILL
ResponsiveImageExtension:
sets:
CarouselSet:
method: CroppedImage
sizes:
- {query: "(min-width: 200px)", size: 480x240}
- {query: "(min-width: 200px) and (-webkit-min-device-pixel-ratio: 1.5)…", size: 960x480}
- {query: "(min-width: 960px)", size: 960x480}
default_size: 960x480
<% loop $CarouselImages %>
<div class="carousel__item">{$CarouselSet}</div>
<% end_if %>
FOCUS
POINT
"jonom/focuspoint"
FOCUS
POINT
UPLOADED IMAGE
CROPPEDIMAGE(580,400)
CROPPEDFOCUSEDIMAGE(580,400)
FOCUS POINT
+
RESPONSIVE
IMAGES
=
AWESOME
CAROUSELS
BLOG
"silverstripe/blog"
NEWS
<% loop $List('BlogPost').Limit(1) %>
…
<% end_with %>
<% loop $List('BlogPost').Limit(3,1) %>
…
<% end_loop %>
CACHE INCLUDE
"heyday/silverstripe-cacheinclude"
EASY CACHE
<% cache %>
<% loop Something %> … <% end_loop %>
<% end_cache %>
<% cache_include 'TemplateName' %>
"heyday/silverstripe-cacheinclude-manager"
SPECIAL
MENTION
PASSING DATA...
<% include Twitter Tweets=2, User="bigfork" %>
...INTO INCLUDES
<a data-tweet-limit="{$Tweets}">…</a>
Tweets by @{$User}
BETTER NAVIGATOR
"jonom/silverstripe-betternavigator"
“I’ve unpublished the page and it’s still showing”
“I’ve unpublished the page and it’s still showing”
CMS MODULES
SECURITY
TEMPLATES
"feejin/silverstripe-securitytemplates"
SECURITY
TEMPLATES
SEO
"silverstripe/googlesitemaps"
"kinglozzer/metatitle"
"kinglozzer/bfgoogleanalytics"
INFOBOXES
"stnvh/silverstripe-infoboxes"
LAST, BUT NOT LEAST
"kinglozzer/htmleditornoalignment"
"kinglozzer/htmleditoruploadfield"
"silverstripe-australia/gridfieldextensions"
GOOD
HOUSEKEEPING
TIDYUP TINYMCE
_CONFIG.PHP
$config = HtmlEditorConfig::get('cms');
$config->disablePlugins('emotions', 'fullscreen');
$config->setButtonsForLine(1, 'formatselect,separator,bullist,numlist,
separator,bold,italic,sup,sub,separator,sslink,unlink,anchor,separator,ssmedia,pasteword,
separator,spellchecker,undo,redo,code');
$config->setButtonsForLine(2, 'tablecontrols');
$config->setButtonsForLine(3, '');
_CONFIG.PHP
$config = HtmlEditorConfig::get('cms');
$config->setOptions(array(
'theme_advanced_blockformats' => 'p,h2,h3',
'paste_auto_cleanup_on_paste' => 'true',
'paste_remove_styles' => 'true',
'paste_strip_class_attributes' => 'all',
'paste_remove_spans' => 'true'
));
PAGE TYPE
CLUTTER
ONE WEIRD TRICK
LeftAndMain::require_css(basename(__DIR__) . '/css/cms.css');
#Form_AddForm_PageType .disabled {
display: none !important;
}
#Menu-Help {
display: none;
}
.cms-logo a {
background-image: url('http://placekitten.com/26/23');
}
BETTER
HOUSE RULES
Always use pages if possible and practical.
If there are too many fields on a page, group them into
tabs. If a tab is too sparsely populated, merge the contents
with another tab.
If something can’t be (or shouldn’t be) a page, can it be a
gridfield within a page? If yes, make it so.
If the thing can’t or shouldn’t be a page, and gridfieldwithin a page isn’t relevant, resort to modeladmin.
FIN.
BIGFORK.CO.UK
@FEEJIN
BONUS MATERIAL
AUTOMATE WHAT?
› Compiling SCSS into CSS
› Linting SCSS
› Automatically adding vendor prefixes where required
› Combining media queries
› Optimising images
› Javascript linting and uglifying
› Live reload
COMPONENT BASED SCSS
style.scss
[includes]
_reset.scss
_typography.scss
[components]
_header.scss
_footer.scss
MEDIA QUERIES MIXIN
.header { background-color: $color__black; }
@include respond(960px) {
.header { background-color: $colour__white; }
}
.header {
background-color: #000;
@include respond(960px) {
background-color: $colour__white;
}
}
@include retina() {
.header { … }
}
CAVEAT EMPTOR
› Media queries inside rules can make them harder to maintain
› mq-combine can reorder CSS so don’t rely on source order for specificity
› mq-combine also breaks source maps :(
BEM
https://en.bem.info
BEM–ISH
READABLE IN HTML
& CSS FILES
<nav class="nav">
<ul class="nav__menu">
<li class="nav__item nav__item--{$LinkingMode}">
<a class="nav__link" href="{$Link}">{$MenuTitle}</a>
</li>
</ul>
</nav>
.nav { … }
.nav__menu { … }
.nav__item { … }
.nav__item--current { … }
SCSS & BEM–ISH
.nav {
…
&__item {
…
&--current {
…
} } }
.nav { … }
.nav__item { … }
.nav__item--current { … }
BAD!
.nav {
…
&__item {
…
&--current {
…
} } }
› Can’t search for rules in source files
› Harder to gauge specificity
QUESTIONS?
BIGFORK.CO.UK
@FEEJIN

Weitere ähnliche Inhalte

Was ist angesagt?

Data Visualization on the Web - Intro to D3
Data Visualization on the Web - Intro to D3Data Visualization on the Web - Intro to D3
Data Visualization on the Web - Intro to D3
Angela Zoss
 
Mongo db on azure for developers
Mongo db on azure for developersMongo db on azure for developers
Mongo db on azure for developers
Mark Greenway
 
Sears Front End Changes
Sears Front End ChangesSears Front End Changes
Sears Front End Changes
Lance Ennen
 

Was ist angesagt? (16)

Sass in 5
Sass in 5Sass in 5
Sass in 5
 
Data Visualization on the Web - Intro to D3
Data Visualization on the Web - Intro to D3Data Visualization on the Web - Intro to D3
Data Visualization on the Web - Intro to D3
 
Create JS - A new kind of web editing interface
Create JS  - A new kind of web editing interfaceCreate JS  - A new kind of web editing interface
Create JS - A new kind of web editing interface
 
Front-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPressFront-End Performance Optimization in WordPress
Front-End Performance Optimization in WordPress
 
MSM Basics & More
MSM Basics & MoreMSM Basics & More
MSM Basics & More
 
Gatsby Themes: Better, Faster, Flexible-er
Gatsby Themes: Better, Faster, Flexible-erGatsby Themes: Better, Faster, Flexible-er
Gatsby Themes: Better, Faster, Flexible-er
 
Mongo db on azure for developers
Mongo db on azure for developersMongo db on azure for developers
Mongo db on azure for developers
 
マルチクラウド #とは
マルチクラウド #とはマルチクラウド #とは
マルチクラウド #とは
 
Sears Front End Changes
Sears Front End ChangesSears Front End Changes
Sears Front End Changes
 
Getting Started with MongoDB using Node.js
Getting Started with MongoDB using Node.jsGetting Started with MongoDB using Node.js
Getting Started with MongoDB using Node.js
 
IBIS - Intelligent Band Information System
IBIS - Intelligent Band Information SystemIBIS - Intelligent Band Information System
IBIS - Intelligent Band Information System
 
Railsgirls: Where did my HTML and CSS go
Railsgirls: Where did my HTML and CSS goRailsgirls: Where did my HTML and CSS go
Railsgirls: Where did my HTML and CSS go
 
JAMstack with gatsby, contentful and netlify aka the dream stack
JAMstack with gatsby, contentful and netlify aka the dream stackJAMstack with gatsby, contentful and netlify aka the dream stack
JAMstack with gatsby, contentful and netlify aka the dream stack
 
Midgard Create and VIE
Midgard Create and VIEMidgard Create and VIE
Midgard Create and VIE
 
Speedup Magento Website
Speedup Magento WebsiteSpeedup Magento Website
Speedup Magento Website
 
What you need to know to be a front end developer in 2019
What you need to know to be a front end developer in 2019What you need to know to be a front end developer in 2019
What you need to know to be a front end developer in 2019
 

Ähnlich wie SilverStripe Modules for a Better Life

Ähnlich wie SilverStripe Modules for a Better Life (20)

Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
 
Pump up the JAM with Gatsby (2019)
Pump up the JAM with Gatsby (2019)Pump up the JAM with Gatsby (2019)
Pump up the JAM with Gatsby (2019)
 
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 201210 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
EnterJS 2015 - Continuous Integration for Frontend Code
EnterJS 2015 - Continuous Integration for Frontend CodeEnterJS 2015 - Continuous Integration for Frontend Code
EnterJS 2015 - Continuous Integration for Frontend Code
 
Class15
Class15Class15
Class15
 
Build Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićBuild Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje Jurišić
 
A High-Performance Solution To Microservices UI Composition
A High-Performance Solution To Microservices UI CompositionA High-Performance Solution To Microservices UI Composition
A High-Performance Solution To Microservices UI Composition
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
 
css-tools
css-toolscss-tools
css-tools
 
Pump up the JAM with Gatsby
Pump up the JAM with GatsbyPump up the JAM with Gatsby
Pump up the JAM with Gatsby
 
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit MavenBuilding Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
 
From CSS to Sass in WordPress
From CSS to Sass in WordPressFrom CSS to Sass in WordPress
From CSS to Sass in WordPress
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 
Engineering the New LinkedIn Profile
Engineering the New LinkedIn ProfileEngineering the New LinkedIn Profile
Engineering the New LinkedIn Profile
 
Website Performance Basics
Website Performance BasicsWebsite Performance Basics
Website Performance Basics
 
RESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsRESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side Components
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 

SilverStripe Modules for a Better Life