mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Changes flush and build URLs for tutorials.
This commit is contained in:
parent
1b1f645157
commit
29c2fec977
@ -145,8 +145,8 @@ or placed between SilverStripe template tags:
|
||||
|
||||
**Flushing the cache**
|
||||
|
||||
Whenever we edit a template file, we need to append *?flush=all* onto the end of the URL, e.g.
|
||||
http://localhost/your_site_name/?flush=all. SilverStripe stores template files in a cache for quicker load times. Whenever there are
|
||||
Whenever we edit a template file, we need to append *?flush=1* onto the end of the URL, e.g.
|
||||
http://localhost/your_site_name/?flush=1. SilverStripe stores template files in a cache for quicker load times. Whenever there are
|
||||
changes to the template, we must flush the cache in order for the changes to take effect.
|
||||
|
||||
## The Navigation System
|
||||
@ -343,7 +343,7 @@ Create a new file *HomePage.php* in *mysite/code*. Copy the following code into
|
||||
|
||||
|
||||
Every page type also has a database table corresponding to it. Every time we modify the database, we need to rebuild it.
|
||||
We can do this by going to [http://localhost/your_site_name/dev/build?flush=all](http://localhost/your_site_name/dev/build?flush=1) (replace *localhost/your_site_name* with your own domain name if applicable).
|
||||
We can do this by going to [http://localhost/your_site_name/dev/build](http://localhost/your_site_name/dev/build) (replace *localhost/your_site_name* with your own domain name if applicable).
|
||||
|
||||
It may take a moment, so be patient. This add tables and fields needed by your site, and modifies any structures that have changed. It
|
||||
does this non-destructively - it will never delete your data.
|
||||
@ -366,7 +366,7 @@ It always tries to use the most specific template in an inheritance chain.
|
||||
|
||||
### Creating a new template
|
||||
|
||||
To create a new template layout, create a copy of *Page.ss* (found in *themes/simple/templates/Layout*) and call it *HomePage.ss*. If we flush the cache (*?flush=all*), SilverStripe should now be using *HomePage.ss* for the homepage, and *Page.ss* for the rest of the site. Now let's customize the *HomePage* template.
|
||||
To create a new template layout, create a copy of *Page.ss* (found in *themes/simple/templates/Layout*) and call it *HomePage.ss*. If we flush the cache (*?flush=1*), SilverStripe should now be using *HomePage.ss* for the homepage, and *Page.ss* for the rest of the site. Now let's customize the *HomePage* template.
|
||||
|
||||
First, we don't need the breadcrumbs and the secondary menu for the homepage. Let's remove them:
|
||||
:::ss
|
||||
|
@ -90,7 +90,7 @@ to be children of the page in the site tree. As we only want **news articles** i
|
||||
|
||||
We will be introduced to other fields like this as we progress; there is a full list in the documentation for `[api:SiteTree]`.
|
||||
|
||||
Now that we have created our page types, we need to let SilverStripe rebuild the database: [http://localhost/your_site_name/dev/build?flush=all](http://localhost/your_site_name/dev/build?flush=all). SilverStripe should detect that there are two new page types, and add them to the list of page types in the database.
|
||||
Now that we have created our page types, we need to let SilverStripe rebuild the database: [http://localhost/your_site_name/dev/build](http://localhost/your_site_name/dev/build). SilverStripe should detect that there are two new page types, and add them to the list of page types in the database.
|
||||
|
||||
<div class="hint" markdown="1">
|
||||
It is SilverStripe convention to suffix general page types with "Page", and page types that hold other page types with
|
||||
@ -177,7 +177,7 @@ There are many more fields available in the default installation, listed in ["fo
|
||||
return $fields;
|
||||
|
||||
|
||||
Finally, we return the fields to the CMS. If we flush the cache (by adding ?flush=all at the end of the URL), we will be able to edit the fields in the CMS.
|
||||
Finally, we return the fields to the CMS. If we flush the cache (by adding ?flush=1 at the end of the URL), we will be able to edit the fields in the CMS.
|
||||
|
||||
Now that we have created our page types, let's add some content. Go into the CMS and create an *ArticleHolder* page named "News", then create a few *ArticlePage*'s within it.
|
||||
|
||||
@ -469,7 +469,7 @@ the CMS.
|
||||
|
||||
![](_images/tutorial2_photo.jpg)
|
||||
|
||||
Rebuild the database ([http://localhost/your_site_name/dev/build?flush=1](http://localhost/your_site_name/dev/build?flush=1)) and open the CMS. Create
|
||||
Rebuild the database ([http://localhost/your_site_name/dev/build](http://localhost/your_site_name/dev/build)) and open the CMS. Create
|
||||
a new *StaffHolder* called "Staff", and create some *StaffPage*s in it.
|
||||
|
||||
![](_images/tutorial2_create-staff.jpg)
|
||||
|
@ -156,7 +156,7 @@ Add the following code to the existing `form.css` file:
|
||||
}
|
||||
|
||||
|
||||
All going according to plan, if you visit [http://localhost/your_site_name/home?flush=all](http://localhost/your_site_name/home?flush=all) it should look something like this:
|
||||
All going according to plan, if you visit [http://localhost/your_site_name/home?flush=1](http://localhost/your_site_name/home?flush=1) it should look something like this:
|
||||
|
||||
![](_images/tutorial3_pollform.jpg)
|
||||
|
||||
@ -179,7 +179,7 @@ If you recall, in the [second tutorial](2-extending-a-basic-site) we said that a
|
||||
);
|
||||
}
|
||||
|
||||
If we then rebuild the database ([http://localhost/your_site_name/dev/build?flush=all](http://localhost/your_site_name/dev/build?flush=all)), we will see that the *BrowserPollSubmission* table is created. Now we just need to define 'doBrowserPoll' on *HomePage_Controller*:
|
||||
If we then rebuild the database ([http://localhost/your_site_name/dev/build](http://localhost/your_site_name/dev/build)), we will see that the *BrowserPollSubmission* table is created. Now we just need to define 'doBrowserPoll' on *HomePage_Controller*:
|
||||
|
||||
**mysite/code/HomePage.php**
|
||||
|
||||
|
@ -18,7 +18,7 @@ This will enable fulltext search on page content as well as names of all files i
|
||||
:::php
|
||||
FulltextSearchable::enable();
|
||||
|
||||
After including that in your `_config.php` you will need to rebuild the database by visiting [http://localhost/your_site_name/home?flush=all](http://localhost/your_site_name/home?flush=all) in your web browser (replace localhost/your_site_name with a domain if applicable). This will add fulltext search columns.
|
||||
After including that in your `_config.php` you will need to rebuild the database by visiting [http://localhost/your_site_name/dev/build](http://localhost/your_site_name/dev/build) in your web browser (replace localhost/your_site_name with a domain if applicable). This will add fulltext search columns.
|
||||
|
||||
The actual search form code is already provided in FulltextSearchable so when you add the enable line above to your `_config.php` you can add your form as `$SearchForm`.
|
||||
|
||||
@ -146,7 +146,7 @@ class.
|
||||
<% end_if %>
|
||||
</div>
|
||||
|
||||
Then finally add ?flush=all to the URL and you should see the new template.
|
||||
Then finally add ?flush=1 to the URL and you should see the new template.
|
||||
|
||||
|
||||
![](_images/tutorial4_search.jpg)
|
||||
|
@ -72,7 +72,7 @@ we don't need to define any additional ones for our purposes.
|
||||
|
||||
Now that we have our models defined in PHP code,
|
||||
we need to tell the database to create the related tables.
|
||||
Trigger a rebuild through *dev/build?flush=all* before you
|
||||
Trigger a rebuild through *dev/build* before you
|
||||
proceed to the next part of this tutorial.
|
||||
|
||||
### Organizing pages: ProjectHolder
|
||||
@ -318,7 +318,7 @@ a named list of object.
|
||||
|
||||
Navigate to the holder page through your website navigation,
|
||||
or the "Preview" feature in the CMS. You should see a list of all projects now.
|
||||
Add `?flush=all` to the page URL to force a refresh of the template cache.
|
||||
Add `?flush=1` to the page URL to force a refresh of the template cache.
|
||||
|
||||
To get a list of all projects, we've looped through the "Children" list,
|
||||
which is a relationship we didn't define explictly.
|
||||
|
Loading…
x
Reference in New Issue
Block a user