silverstrap 

silverstrap Commit Details

Date:2013-06-16 19:25:35 (6 years 3 months ago)
Author:Nicola Fontana
Branch:bootstrap2, dev, master, master-1.0, ss3
Commit:6f863ad62e10ceae3df91cb6036a9383d411014a
Parents: 0a66368845fbff0bd35249fb814f0f67ce75c33d
Message:Updated docs for publishing

Added GNU required docs (AUTHORS and LICENSE) and improved README.md,
formatting it in markdown.
Changes:
DREADME (full)
AAUTHORS (full)
ALICENSE (full)
AREADME.md (full)

File differences

AUTHORS
1
Nicola Fontana <ntd at entidi.it>
LICENSE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Copyright (c) 2012 Nicola Fontana <ntd@entidi.it>. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
README
1
2
3
4
5
6
7
8
9
The default implementation provides support for custom nested levels
in .navlist but does not provide a way to access the parent nodes (as
usually done in vanilla SilverStripe). To achieve this you must override
NavbarItem.ss and add a fixed item at the beginning of the <ul>, right
before looping on $Children:
<li class="$LinkingMode">
<a href="$Link.ATT" title="<%t Silverstrap.GOTO page=$Title.ATT %>">$Title</a>
</li>
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
SilverStrap
===========
A [SilverStripe](http://www.silverstripe.org/) theme based on the
[Bootstrap](http://twitter.github.io/bootstrap/) front-end framework.
It should work out of the box on basic sites, so you can drop it into
your `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.
Features
--------
* Should work out of the box.
* By leveraging the
[silverstripe-autotoc](http://dev.entidi.com/p/silverstripe-autotoc/)
module, the table of contents can be generated dinamically for every
page by inspecting the `<h1>..<h6>` tags of the page content. Your
site will gain table of contents for free.
* Proper support for pages nested at arbitrary levels.
* Quite extensible and customizable.
Accessing parent pages
----------------------
The default implementation provides support for custom nested levels
in *.navlist* but does not provide a way to access the parent pages, as
commonly provided by vanilla SilverStripe. In other words, if you have
subpages under `yoursite/contacts/` you can access them but there is no
easy way to access `yoursite/contacts/`.
To alleviate the problems a *Sitemap* of the first two levels is put
before the footer. This does not resolve the problem for further levels,
though.
To be able to access the parent pages directly from *.navlist* you must
override `NavbarItem.ss` and add a fixed item at the beginning of the
`<ul>` list, right before looping on $Children:
<li class="$LinkingMode">
<a href="$Link.ATT" title="<%t Silverstrap.GOTO page=$Title.ATT %>">$Title</a>
</li>
Overriding bootstrap.css
------------------------
Let's say you want to use a custom Bootstrap theme, such as the ones
provided by [Bootswatch](http://bootswatch.com/): you can download and
save the CSS in `silverstrap/css/bootstrap.css`. It works, but will
override the default CSS provided by silverstrap... and this is bad.
You loose the possibility to update silverstrap with a `git pull`.
Instead, you can use the SilverStripe template trick used by
[silverstripe-treeish](http://dev.entidi.com/p/silverstripe-treeish/)
to use a different CSS file:
1. put silverstrap under `themes` (as usual).
2. create a `silverstrap_Page` directory at the same directory level:
any page of type `Page` (hence the whole site) will look in this
directory before for every template;
3. copy the custom bootstrap CSS in some place accessible by the web
server, e.g. under `themes/silverstrap_Page/css/mybootstrap.css`;
4. create `themes/silverstrap_Page/templates/Includes/Bootstrap.ss`
and put the following template code in it:
<%-- Override the default bootstrap theme with the custom one --%>
<% require CSS(themes/silverstrap_Page/css/mybootstrap.css) %>
<% require themedCSS(bootstrap-responsive) %>
<script src="$ThemeDir/js/bootstrap.min.js"></script>

Archive Download the corresponding diff file