21493 Posts in 5784 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1020 Views |
-
Can't see Homepage.ss in dropdown menu

12 August 2010 at 11:36pm Last edited: 12 August 2010 11:39pm
Hi there,
New to silverstripe, and have just followed through the tutorial, but when I get to the last part on tutorial1, I create the HomePage.ss file, but I can't see the option in the dropdown menu for my homepage
Is there something else I need to be doing?
I've tried adding flus to the end of my admin panel like so, but it still doesn't show:
http://mydomain.com/index.php/admin?flush=1thanks,
-
Re: Can't see Homepage.ss in dropdown menu

13 August 2010 at 4:01pm
Hi kevyn,
Welcome to the forums. Note you need a HomePage.php more importantly. Not just a SS file. Make sure you have a HomePage.php file with at least
<?php
class HomePage extends Page {
}
class HomePage_Controller extends Page_Controller {
}
-
Re: Can't see Homepage.ss in dropdown menu

13 August 2010 at 8:14pm
Thanks Willr, I've added the HomePage.php file, however I still can't see homepage in the dropdown menu.
I've tried doing this part: "We can do this by going to http://localhost/dev/build?flush=1. "
but I'm having no luck, when I try this I get a 404 because I don't have a dev folder in the root. I do have a dev folder here: /sapphire/dev/build?flush=1 but that also doesn't do anything because I don't have a file called build.
I'm feeling a little lost! any help would be much appreciated
my homepage php contains the exact text from the tutorial:
<?php
/**
* Defines the HomePage page type
*/class HomePage extends Page {
static $db = array(
);
static $has_one = array(
);}
class HomePage_Controller extends Page_Controller {
}
?> -
Re: Can't see Homepage.ss in dropdown menu

14 August 2010 at 9:13am
You don't need a directory called 'dev'. SilverStripe uses URL Rewriters to translate those 'nice' urls into actual classes and methods. I think the issue is here is you do not have mod_rewrite enabled since your admin link looks like
http://mydomain.com/index.php/admin?flush=1
Note the index.php part. This tells you that mod_rewrite isn't working as otherwise you would have http://mydomain.com/admin. So when you see a URL used in the documentation like dev/build this will have to come *after* the index.php line like
http://mydomain.com/index.php/dev/build?flush=1
Hope that makes sense!
-
Re: Can't see Homepage.ss in dropdown menu

16 August 2010 at 8:08pm
Well this is what I thought, however my host tells me that mod_rewrite is enabled, and showed me a screenshot to prove that it is enabled, so I don't know what is going on
Would mod_rewrite stop my homepage.ss from being shown in the dropdown menu though?
-
Re: Can't see Homepage.ss in dropdown menu

18 August 2010 at 4:19am
In order for a page to show up in your drop down it has to be 'built' first - hence the need to run /dev/build. Every time you add a new file you need to run a build.
I think you should shake out the issues you are having with mod_rewrite and you will be good-to-go.
-
Re: Can't see Homepage.ss in dropdown menu

18 August 2010 at 10:52pm Last edited: 18 August 2010 11:24pm
Hi again - I've just dealt with my webhost (webhostuk.uk.net) who have been awesome, and fixed the problem for me.
they say that the problem was with my htaccess file not being correct, and they took the one from the SS directory and replaced mine, and now all seems to be ok.
I'm not sure if this is something that should happen automatically or not, and they say that mod_rewrite is always enabled by default on their servers, so I'm not sure if the problem was with the SS install or something I did wrong.
But basically, replacing the htaccess file with the one in the SS directory solved the URL rewriting, and enabled me to do the dev/flush which has let me view my other page templates
now to get stuck into silverstripe!
edit: here is what my htaccess file now looks like
### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files><Files web.config>
Order deny,allow
Deny from all
</Files><IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ### -
Re: Can't see Homepage.ss in dropdown menu

20 August 2010 at 1:06pm
Thanks you for the post.
Hi guys, Im a newbie. Nice to join this forum.__________________
Watch The Switch Online Free
| 1020 Views | ||
|
Page:
1
|
Go to Top |



