A SilverStripe theme based on the
Bootstrap front-end framework.
It should work out of the box on basic sites, so you can drop it into
themes folder, enable it (either programmatically by using
SSViewer::set_theme('silverstrap') or by switching it in the CMS) and
check how your new site look.
The master-1.0 branch is in maintenance mode and it is based on the deprecated (and no longer officially supported) Bootstrap version 2. The master and dev branches, released as silverstrap-2.x.x, are based on Bootstrap 3.
composer require entidi/silverstrap
Without composer, download the tarball
and unpack it under the
themes/or install via
composerand enable it.
Silverstrap depends on some external project:
Colorbox and Fotorama are not strictly required but are useful when silverstrap is used in conjunction with other modules. In any case, all those components are included out of the box by the base templates.
By default the resources are fetched from the jsdelivr CDN network (see
SilverstrapJsdelivr.ss template) but a couple of alternatives are
SilverstrapOffline.ssfetches the resources directly from the filesystem, making the site usable when disconnected from internet;
SilverstrapModular.ssfetches the resources from jsdelivr too but it is modular, e.g. every dependency has its own template.
Depending on your requirements, you can prefer one of these methods
instead of the default one. If this is the case, just override
Silverstrap.ss to include the offline or the modular version. Consult
the next session to know how to override templates.
silverstrap.js defines the global object
silverstrap where all the
To override this settings (i.e. to change the out of the box behavior of
<script src="themes/silverstrap/js/silverstrap.js></script> <script> // Disable fullscreen in fotorama silverstrap.fotorama.allowfullscreen = false; // Colorbox zoom to 50% max silverstrap.colorbox.maxWidth = '50%'; silverstrap.colorbox.maxHeight = '50%'; </script>
Let's say you want to work off-line so you need to not depend on a CDN,
as required out of the box by silverstrap. You can just modify
silverstrap/templates/Includes/Silverstrap.ss and change the code to
SilverstrapOffline instead of
this works, it will change the silverstrap directory tree... and this
is very bad: you'll loose the possibility to update silverstrap with a
git pull or by leveraging
Instead you can use the SilverStripe template trick used by the silverstripe-treeish project, i.e. override any template without touching a single byte of the original folder:
composerwill do this for you;
silverstrap_Pagedirectory at the same level of the
silverstrapdirectory: any page of type
Page(hence the whole site) will look for templates in this directory first;
silverstrap_Page, retaining its relative path;
In the case outlined by this section, you can copy
silverstrap_Page/templates/Includes/Silverstrap.ss and change its
<% include SilverstrapOffline %>
This trick can be used to override pretty much everything, such as to enhance the default page template, to set the favicon, to add or remove a feature or to put a watermark on every page. The templates in silverstrap are quite fragmented to make the overriding easier. For example, silverstripe-cerulean is an extension to Silverstrap that uses this very same approach to override the default plain Bootstrap theme with the Cerulean one.
The default implementation provides support for custom nested levels
in .navbar but does not provide a way to access the parent pages, as
commonly provided by vanilla SilverStripe. In other words, if you have
yoursite/contacts/ you can access them but there is no
easy way to access
yoursite/contacts/ (apart from directly write the
To alleviate the problems a Sitemap of the first two levels is put by default before the footer. This does not resolve the problem for further levels though.
To be able to access the parent pages directly from the .navbar you
NavbarSubmenu.ss and add a fixed item at the beginning
<ul> list, right before looping on
NavbarSubmenuAccessible.ss file does exactly that, so you should use
it instead of the original template. By leveraging the override trick
explained in the previous section, you can accomplish this by creating
themes/silverstrap_Page/templates/Includes/NavbarItem.ss under your
website directory with the following content:
<% if $Children %><% if $Parent %> <% include NavbarSubmenuAccessible %><% else %> <% include NavbarMenu %><% end_if %> <% else %> <% include NavbarLink %> <% end_if %>
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem