diff --git a/docs/en/00_Getting_Started/00_Server_Requirements.md b/docs/en/00_Getting_Started/00_Server_Requirements.md index e3a862853..bd379b6d5 100644 --- a/docs/en/00_Getting_Started/00_Server_Requirements.md +++ b/docs/en/00_Getting_Started/00_Server_Requirements.md @@ -1,8 +1,8 @@ # Requirements -SilverStripe CMS needs to be installed on a web server. Content authors and website administrators use their web browser to access a web-based GUI to -do their day-to-day work. Website designers and developers require access to the files on the server to update templates, -website logic, and perform upgrades or maintainance. +SilverStripe CMS needs to be installed on a web server. Content authors and website administrators use their web browser +to access a web-based GUI to do their day-to-day work. Website designers and developers require access to the files on +the server to update templates, website logic, and perform upgrades or maintenance. Our web-based [PHP installer](/installation) can check if you meet the requirements listed below. @@ -36,14 +36,26 @@ Our web-based [PHP installer](/installation) can check if you meet the requireme ## Web server hardware requirements -Hardware requirements vary widely depending on the traffic to your website, the complexity of its logic (i.e., PHP), and its size (i.e., database.) By default, all pages are dynamic, and thus access both the database and execute PHP code to generate. SilverStripe can cache full pages and segments of templates to dramatically increase performance. +Hardware requirements vary widely depending on the traffic to your website, the complexity of its logic (i.e., PHP), and +its size (i.e., database.) By default, all pages are dynamic, and thus access both the database and execute PHP code to +generate. SilverStripe can cache full pages and segments of templates to dramatically increase performance. -A typical website page on a conservative single CPU machine (e.g., Intel 2Ghz) takes roughly 300ms to generate. This comfortably allows over a million page views per month. Caching and other optimisations can improve this by a factor of ten or even one hundred times. SilverStripe CMS can be used in multiple-server architectures to improve scalability and redundancy. +A typical website page on a conservative single CPU machine (e.g., Intel 2Ghz) takes roughly 300ms to generate. This +comfortably allows over a million page views per month. Caching and other optimisations can improve this by a factor of +ten or even one hundred times. SilverStripe CMS can be used in multiple-server architectures to improve scalability and +redundancy. + +For more information on how to scale SilverStripe see the [Performance](../../developer_guides/performance/) Gluide. ## Client side (CMS) requirements -SilverStripe CMS is designed to work well with Google Chrome, Mozilla Firefox and Internet Explorer 8+. We aim to provide satisfactory experiences in Apple Safari. SilverStripe CMS works well across Windows, Linux, and Mac operating systems. +SilverStripe CMS is designed to work well with Google Chrome, Mozilla Firefox and Internet Explorer 8+. We aim to +provide satisfactory experiences in Apple Safari. SilverStripe CMS works well across Windows, Linux, and Mac operating +systems. -## End user requirements ## +## End user requirements -SilverStripe CMS is designed to make excellent, standards-compliant websites that are compatible with a wide range of industry standard browsers and operating systems. A competent developer is able to produce websites that meet W3C guidelines for HTML, CSS, JavaScript, and accessibility, in addition to meeting specific guildelines, such as e-government requirements. +SilverStripe CMS is designed to make excellent, standards-compliant websites that are compatible with a wide range of +industry standard browsers and operating systems. A competent developer is able to produce websites that meet W3C +guidelines for HTML, CSS, JavaScript, and accessibility, in addition to meeting specific guildelines, such as +e-government requirements. diff --git a/docs/en/00_Getting_Started/index.md b/docs/en/00_Getting_Started/index.md index 66c2a3ee0..e3937e382 100644 --- a/docs/en/00_Getting_Started/index.md +++ b/docs/en/00_Getting_Started/index.md @@ -1,15 +1,8 @@ -# Installing SilverStripe +title: Getting Started +introduction: SilverStripe is a web application. This means that you will need to have a webserver and database. We will take you through the setup of the server environment as well the application itself. -## Download -SilverStripe is a web application. This means that you will need to have a webserver and database meeting its -[requirements](server-requirements). We will take you through the setup of the server environment as well the application itself. - -
-![](../_images/composer.png) -
- -## Getting the code +## Installing SilverStripe The best way to get SilverStripe is to [install with Composer](composer). Composer is a package management tool for PHP that lets you install and upgrade SilverStripe and its modules. Although installing Composer is one extra step, it will give you much more flexibility than just downloading the file from silverstripe.org. diff --git a/docs/en/01_Tutorials/index.md b/docs/en/01_Tutorials/index.md index b36af9a53..6683d8417 100644 --- a/docs/en/01_Tutorials/index.md +++ b/docs/en/01_Tutorials/index.md @@ -1,4 +1,7 @@ -# Written Tutorials +title: Tutorials +introduction: The tutorials below take a step by step look at how to build a SilverStripe application. + +## Written Tutorials * [Tutorial 1: Building a basic site](1-building-a-basic-site): An introduction to building a site with SilverStripe. @@ -9,14 +12,14 @@ site". * [Tutorial 5: Dataobject Relationship Management](5-dataobject-relationship-management): Learn how to create simple data relationships. -# Video tutorials +## Video tutorials * [Installing on Linux](http://silverstripe.org/assets/screencasts/Tutorial-InstallingLinux-DM08.swf) * [Installing on Mac OSX (using MAMP)](http://silverstripe.org/assets/screencasts/Tutorial-InstallingMAMP-SW08.swf) * [Installing a module (e.g. a blog)](http://silverstripe.org/assets/screencasts/Tutorial-InstallingBlogModule-DM08.swf) * [Customising the CMS (adding new fields)](http://silverstripe.org/assets/screencasts/Tutorial-ChangingFields-DM08.swf) -# Help: If you get stuck +## Help: If you get stuck * [Common Problems](/installation/common-problems): Review some existing solutions to common problems. * [SilverStripe Forums](http://www.silverstripe.com/silverstripe-forum/): Head over to the forums and ask the community diff --git a/docs/en/02_Developer_Guides/00_Model/index.md b/docs/en/02_Developer_Guides/00_Model/index.md new file mode 100644 index 000000000..92412ffb1 --- /dev/null +++ b/docs/en/02_Developer_Guides/00_Model/index.md @@ -0,0 +1,8 @@ +title: Model and Databases +summary: Learn how SilverStripe manages database tables, ways to query your database and how to publish data. + +[CHILDREN] + +## How-to + +[CHILDREN How_To] \ No newline at end of file diff --git a/docs/en/02_Developer_Guides/01_Templates_and_Views/00_Page_Type_Templates.md b/docs/en/02_Developer_Guides/01_Templates/00_Page_Type_Templates.md similarity index 97% rename from docs/en/02_Developer_Guides/01_Templates_and_Views/00_Page_Type_Templates.md rename to docs/en/02_Developer_Guides/01_Templates/00_Page_Type_Templates.md index dc86e2666..d3fa469ec 100644 --- a/docs/en/02_Developer_Guides/01_Templates_and_Views/00_Page_Type_Templates.md +++ b/docs/en/02_Developer_Guides/01_Templates/00_Page_Type_Templates.md @@ -1,9 +1,9 @@ # Building templates for page types -Much of your work building a SilverStripe site will involve the creation of -templates for your own page types. SilverStripe has its own template language. +Much of your work building a SilverStripe site will involve the creation of +templates for your own page types. SilverStripe has its own template language. Its basic features like variables, blocks and loops are described in our ["templates" reference guide](/reference/templates). -In this guide, we'll show you specific uses for creating page layouts. +In this guide, we'll show you specific uses for creating page layouts. This assumes you are familiar with the concept of ["page types"](/topics/page-types). To get a feel for what those templates look like, let's have a look at an abbreviated example. In your webroot, these templates are usually located in `themes//templates`. @@ -24,21 +24,21 @@ Most of the magic happens in `Page.ss` and `Layout/Page.ss`.

Bob's Chicken Shack

- + <% if $Menu(1) %> <% end_if %> - +
$Layout
- + @@ -85,7 +85,7 @@ and only preview draft content if explicitly requested (e.g. by the "preview" fe `$Menu(1)` is a built-in page control that defines the top-level menu. You can also create a sub-menu using `$Menu(2)`, and so forth. -The `<% loop $Menu(1) %>...<% end_loop %>` block defines a repeating element. +The `<% loop $Menu(1) %>...<% end_loop %>` block defines a repeating element. It will change the "scope" of your template, which means that all of the template variables you use inside it will refer to a menu item. The template code will be repeated once per menu item, with the scope set to that menu item's page. In this case, a menu item refers to an instance of the `Page` class, so you can access all properties defined on there, for example `$Title`. @@ -116,13 +116,13 @@ underneath a "staff" holder on any page, regardless if its on the top level or e This will show all children of a page even if the `ShowInMenus` property is set to FALSE. ### Access to Parent and Level Pages - + :::ss <% with $Level(1) %> $Title <% end_with %> -Will return a page in the current path, at the level specified by the numbers. +Will return a page in the current path, at the level specified by the numbers. It is based on the current page context, looking back through its parent pages. For example, imagine you're on the "bob marley" page, @@ -164,7 +164,7 @@ you can get an absolute one including the domain through [$AbsoluteLink](api:Sit In addition, each menu item gets some context information relative to the page you're currently viewing, contained in the `$LinkingMode` placeholder. -By setting a HTML class to this value, you can distinguish the styling of +By setting a HTML class to this value, you can distinguish the styling of the currently selected menu item. It can have the following values: * `link`: You are neither on this page nor in this section. @@ -176,7 +176,7 @@ More common uses: * `$LinkOrCurrent`: Determines if the item is the current page. Returns "link" or "current" strings. * `$LinkOrSection`: Determines if the item is in the current section, so in the path towards the current page. Useful for menus which you only want to show a second level menu when you are on that page or a child of it. Returns "link" or "section" strings. * `InSection(page-url)`: This if block will pass if we're currently on the page-url page or one of its children. - + Example: Only show the menu item linked if its the current one: :::ss @@ -237,13 +237,13 @@ By default `$MetaTags` renders: #### URLSegment -This returns the part of the URL of the page you're currently on. +This returns the part of the URL of the page you're currently on. Shouldn't be used for linking to a page, since the link is a composite value based on all parent pages as well (through the `$Link` variable). #### ClassName -Returns the class of the underlying `Page` record. +Returns the class of the underlying `Page` record. This can be handy to add to your `` tag to influence CSS styles and JavaScript behaviour based on the page type used: @@ -255,7 +255,7 @@ use the `$CSSClasses` placeholder instead. #### BaseHref -Returns the base URL for the current site. +Returns the base URL for the current site. This is used to populate the `` tag by default. Can be handy to prefix custom links (not generated through `SiteTree->Link()`), to ensure they work correctly when the webroot is hosted in a subfolder diff --git a/docs/en/02_Developer_Guides/01_Templates_and_Views/01_Templates.md b/docs/en/02_Developer_Guides/01_Templates/01_Templates.md similarity index 96% rename from docs/en/02_Developer_Guides/01_Templates_and_Views/01_Templates.md rename to docs/en/02_Developer_Guides/01_Templates/01_Templates.md index 1311bd120..2a7a58cfd 100644 --- a/docs/en/02_Developer_Guides/01_Templates_and_Views/01_Templates.md +++ b/docs/en/02_Developer_Guides/01_Templates/01_Templates.md @@ -21,19 +21,19 @@ Here is a very simple template:

Bob's Chicken Shack

- + <% with $CurrentMember %>

Welcome $FirstName $Surname.

<% end_with %> - + <% if $Dishes %> <% end_if %> - + <% include Footer %> @@ -131,7 +131,7 @@ See [CSS](/topics/css) and [Javascript](/topics/javascript) topics for individua ## Conditional Logic -You can conditionally include markup in the output. That is, test for something +You can conditionally include markup in the output. That is, test for something that is true or false, and based on that test, control what gets output. The simplest if block is to check for the presence of a value. @@ -141,8 +141,8 @@ The simplest if block is to check for the presence of a value.

You are logged in as $CurrentMember.FirstName $CurrentMember.Surname.

<% end_if %> -The following compares a page property called `MyDinner` with the value in -quotes, `kipper`, which is a **literal**. If true, the text inside the if-block +The following compares a page property called `MyDinner` with the value in +quotes, `kipper`, which is a **literal**. If true, the text inside the if-block is output. :::ss @@ -150,12 +150,12 @@ is output. Yummy, kipper for tea. <% end_if %> -Note that inside a tag like this, variables should have a '$' prefix, and -literals should have quotes. SilverStripe 2.4 didn't include the quotes or $ -prefix, and while this still works, we recommend the new syntax as it is less +Note that inside a tag like this, variables should have a '$' prefix, and +literals should have quotes. SilverStripe 2.4 didn't include the quotes or $ +prefix, and while this still works, we recommend the new syntax as it is less ambiguous. -This example shows the use of the `else` option. The markup after `else` is +This example shows the use of the `else` option. The markup after `else` is output if the tested condition is *not* true. :::ss @@ -165,9 +165,9 @@ output if the tested condition is *not* true. I wish I could have kipper :-( <% end_if %> -This example shows the user of `else_if`. There can be any number of `else_if` -clauses. The conditions are tested from first to last, until one of them is true, -and the markup for that condition is used. If none of the conditions are true, +This example shows the user of `else_if`. There can be any number of `else_if` +clauses. The conditions are tested from first to last, until one of them is true, +and the markup for that condition is used. If none of the conditions are true, the markup in the `else` clause is used, if that clause is present. :::ss @@ -186,7 +186,7 @@ This example shows the use of `not` to negate the test. I'm going out for dinner tonight. <% end_if %> -You can combine two or more conditions with `||` ("or"). The markup is used if +You can combine two or more conditions with `||` ("or"). The markup is used if *either* of the conditions is true. :::ss @@ -194,7 +194,7 @@ You can combine two or more conditions with `||` ("or"). The markup is used if yummy, fish for tea <% end_if %> -You can combine two or more conditions with `&&` ("and"). The markup is used if +You can combine two or more conditions with `&&` ("and"). The markup is used if *both* of the conditions are true. :::ss @@ -211,7 +211,7 @@ You can use inequalities like `<`, `<=`, `>`, `>=` to compare numbers. ## Looping Over Lists -The `<% loop %>...<% end_loop %>` tag is used to **iterate** or loop over a +The `<% loop %>...<% end_loop %>` tag is used to **iterate** or loop over a collection of items. For example: :::ss @@ -235,7 +235,7 @@ with. ### Position Indicators -Inside the loop scope, there are many variables at your disposal to determine the +Inside the loop scope, there are many variables at your disposal to determine the current position in the list and iteration: * `$Even`, `$Odd`: Returns boolean, handy for zebra striping @@ -297,8 +297,8 @@ $Modulus and $MultipleOf can help to build column layouts. $Modulus(value, offset) // returns an int $MultipleOf(factor, offset) // returns a boolean. -The following example demonstrates how you can use $Modulus(4) to generate -custom column names based on your loop statement. Note that this works for any +The following example demonstrates how you can use $Modulus(4) to generate +custom column names based on your loop statement. Note that this works for any control statement (not just children). :::ss @@ -308,10 +308,10 @@ control statement (not just children). <% end_loop %> -Will return you column-3, column-2, column-1, column-0, column-3 etc. You can +Will return you column-3, column-2, column-1, column-0, column-3 etc. You can use these as styling hooks to float, position as you need. -You can also use $MultipleOf(value, offset) to help build columned layouts. In +You can also use $MultipleOf(value, offset) to help build columned layouts. In this case we want to add a
after every 3th item. :::ss @@ -323,17 +323,17 @@ this case we want to add a
after every 3th item. ## Scope -In the `<% loop %>` section, we saw an example of two **scopes**. Outside the -`<% loop %>...<% end_loop %>`, we were in the scope of the page. But inside the -loop, we were in the scope of an item in the list. The scope determines where -the value comes from when you refer to a variable. Typically the outer scope of -a page type's layout template is the page that is currently being rendered. +In the `<% loop %>` section, we saw an example of two **scopes**. Outside the +`<% loop %>...<% end_loop %>`, we were in the scope of the page. But inside the +loop, we were in the scope of an item in the list. The scope determines where +the value comes from when you refer to a variable. Typically the outer scope of +a page type's layout template is the page that is currently being rendered. The outer scope of an included template is the scope that it was included into. ### Up -When we are in a scope, we sometimes want to refer to the scope outside the -<% loop %> or <% with %>. We can do that easily by using `$Up`. `$Up` takes +When we are in a scope, we sometimes want to refer to the scope outside the +<% loop %> or <% with %>. We can do that easily by using `$Up`. `$Up` takes the scope back to the previous level. Take the following example: :::ss @@ -349,7 +349,7 @@ the scope back to the previous level. Take the following example: <% end_loop %> <% end_loop %> -With a page structure (Blog -> Blog entry -> Child blog entry) the +With a page structure (Blog -> Blog entry -> Child blog entry) the above will produce: :::ss @@ -364,8 +364,8 @@ above will produce: ### Top -While `$Up` provides us a way to go up 1 scope, `$Top` is a shortcut to jump to -the top most scope of the page. Using the previous example but expanded to +While `$Up` provides us a way to go up 1 scope, `$Top` is a shortcut to jump to +the top most scope of the page. Using the previous example but expanded to include `$Top`: :::ss @@ -393,12 +393,12 @@ Will produce Blog -- Child blog entry - Blog entry + Blog entry Blog ### With -The `<% with %>...<% end_with %>` tag lets you introduce a new scope. Consider +The `<% with %>...<% end_with %>` tag lets you introduce a new scope. Consider the following example: :::ss @@ -407,13 +407,13 @@ the following example: <% end_with %> -Outside the `<% with %>...<% end_with %>`, we are in the page scope. Inside it, -we are in the scope of `$CurrentMember`. We can refer directly to properties and -methods of that member. So $FirstName is equivalent to $CurrentMember.FirstName. -This keeps the markup clean, and if the scope is a complicated expression we don't +Outside the `<% with %>...<% end_with %>`, we are in the page scope. Inside it, +we are in the scope of `$CurrentMember`. We can refer directly to properties and +methods of that member. So $FirstName is equivalent to $CurrentMember.FirstName. +This keeps the markup clean, and if the scope is a complicated expression we don't have to repeat it on each reference of a property. -`<% with %>` also lets us use a collection as a scope, so we can access +`<% with %>` also lets us use a collection as a scope, so we can access properties of the collection itself, instead of iterating over it. For example: :::ss @@ -423,8 +423,8 @@ returns the number of items in the $Children collection. ## Pagination -Lists can be paginated, and looped over to generate pagination. For this to -work, the list needs to be wrapped in a `[api:PaginatedList]`. The process is +Lists can be paginated, and looped over to generate pagination. For this to +work, the list needs to be wrapped in a `[api:PaginatedList]`. The process is explained in detail on the ["pagination" howto](/howto/pagination). The list is split up in multiple "pages", each . Note that "page" is this context @@ -457,7 +457,7 @@ which is of this type. It forces the content into an explicitly escaped format. Apart from value formatting, there's many methods to transform them as well, For example, the built in `$Now` placeholder is an instance of `[api:Date]`, -and returns the current date in a standard system format. +and returns the current date in a standard system format. Since its an object, you can use the helper methods to return other formats: :::ss @@ -481,7 +481,7 @@ Pulling apart this example we see: ## Comments -Using standard HTML comments is supported. These comments will be included in the published site. +Using standard HTML comments is supported. These comments will be included in the published site. :::ss $EditForm @@ -507,10 +507,10 @@ It renders in the template as ` - + - +
$Layout
- + @@ -184,7 +184,7 @@ Next is a division for the main navigation. This may contain something like: