Hi
We (ioWow) are newbies to Silverstripe but not to web development. Having said that, we are (not just I) having problems trying to create a second template to use as the default landing page, but have already got the main site template set and running nicely.
I have spent hours scouring the forum for tips, and in particular spent a couple of hours going through the steps recommended in the Tutorial 1: Building a Basic Web Site > mostly because it took me a couple of hours to figure out just what you meant by flushing in reference to the database....how? nothing was clearly said except for the flush command (append /?flush=1) ....in the end I worked out that what was meant was: type the flush command in the URL bar of your browser as a normal URL but with the flush command appended to the domain name..... Ok it worked...I even found I could FLush=all...sorry but not quite a YAY! yet.
(Suggestion: the writer(s) of the guide and a lot of the people who help with advice, assume everyone has a level of expertise that you have gained with familiarity and no doubt months and months if not years of experience....to those of use who don't have that familiarity and who have always assumed a flush command refers to the rest room....why not just add the text: "Add / Append /?flush=1 to your domain name in the URL bar of your browser"... and that ends all those hours spent trying to work out how to....simple, use your browser not mYSQL, PHPMyadmin etc etc)
But that's not what I am posting for this time.
I have completed the following steps setting up this new home page:
1. Create a new page type
In notepad, added the code below to a new blank page and created
a new file HomePage.php
<?php
/**
* Defines the HomePage page type
*/
class HomePage extends Page {
static $db = array(
);
static $has_one = array(
);
}
class HomePage_Controller extends Page_Controller {
}
?>
Step 2. Upload to mysite/code directory in our test site.
Step 3. Update the database using /?flush=1 command
For example - http://www.ourdomain.com/?flush=1
(have also used /?flush=all
Step 4. Go to the CMS and ...???
Well the tutorial says: As we have just created a new page type, SilverStripe will add this to the list of page types in the database
<Heading>Changing the page type of the Home page
After building the database, we can change the page type of the homepage in the CMS, under the “Behaviour†tab. Change it to HomePage, and click “Save Draft†and “Publishâ€.
...AND here we start having problems again. I / we look in the CMS and create a new page but cannot find any option to Change to a Home Page.
Currently a Page is there...as is Change to Error Page, Redirector Page, Subscribe Form, User Defined and Virtual. BUT Change to a Home Page is not in this drop down menu.
Once I can define the new home page as a home page and assign a new template (next step after we resolve this step) we will be cruising...
Your advice, help and comments are more than appreciated.
Daniel
ioWow