Weitere ähnliche Inhalte Ähnlich wie SilverStripe Modules for a Better Life (20) Kürzlich hochgeladen (20) SilverStripe Modules for a Better Life2. “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.”
3. BOOTSTRAP
$ git clone https://github.com/feejin/Silverstripe-CleanInstall.git
$ cd my-project
$ composer install
19. EASY CACHE
<% cache %>
<% loop Something %> … <% end_loop %>
<% end_cache %>
<% cache_include 'TemplateName' %>
"heyday/silverstripe-cacheinclude-manager"
29. LAST, BUT NOT LEAST
"kinglozzer/htmleditornoalignment"
"kinglozzer/htmleditoruploadfield"
"silverstripe-australia/gridfieldextensions"
32. _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, '');
39. 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.
40. If something can’t be (or shouldn’t be) a page, can it be a
gridfield within a page? If yes, make it so.
41. If the thing can’t or shouldn’t be a page, and gridfieldwithin a page isn’t relevant, resort to modeladmin.
44. 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
46. 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 { … }
}
47. 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 :(
50. 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 { … }
51. SCSS & BEM–ISH
.nav {
…
&__item {
…
&--current {
…
} } }
.nav { … }
.nav__item { … }
.nav__item--current { … }