17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1654 Views |
-
Problem with Poll in tutorial 3

30 May 2007 at 3:37am
Hello there!
First of all my complements to this amazing framework!! Really easy to learn.
I'm running SS on a linux server / apache2 with modrewrite and php 5.2.1
I tried to create the browser poll. The first problem was that it could find the class BrowserPollSubmission witch i created in mysite/code/BrowserPollSubmission.php.
I solved that by simply copy the class into the HomePage.php file.
Next problem, when submitting the poll i get the following error :
ERROR:
ErrorThe website server has not been able to respond to your request.
Any idea?
Thanks a lot!
-
Re: Problem with Poll in tutorial 3

30 May 2007 at 9:07am
Do you have only one dir with your code, like "mysite"?
I copied "mysite" to "mysite.orig" and it made me problems, because the autoloader has loaded files from "mysite.orig" first. when I deleted "mysite.orig", then the problem was solved.
-
Re: Problem with Poll in tutorial 3

30 May 2007 at 9:11am Last edited: 30 May 2007 9:12am
Hi there,
The error obviously isn't descriptive enough, since the site is probably in a mode where it wouldn't normally give you error pages.
Put this line in _config.php:
Director::set_environment_type('dev');
And try producing the same result again, it should this time give you an error that you can actually trace back.
Cheers,
Sean -
Re: Problem with Poll in tutorial 3

30 May 2007 at 11:27am
You can't add the BrowserPollSubmission class into HomePage.php, it needs to be in a file with with same name as the class for SilverStripe to find it. Make sure that whenever you add a new php file you do db build (http://sitename.com/db/build?flush=1).
-
Re: Problem with Poll in tutorial 3

2 June 2007 at 9:21am
Thanks for all the reactions guys!
That debug function blew my mind!!! Really great framework!!
Got a next challenge though
I'm trying to create a menu with 2 levels like -->
<ul>
<li> text </li>
<li class="expand">text
<ul>
<li> text</li>
<li>text</li>
</ul>
</li>
<li> text </li>
<li> text </li>
<li> text </li>
</ul>I'm an absolute beginner with silverstripe, but my php knowlegde isn't that bad though
Thank you for your responses!
-
Re: Problem with Poll in tutorial 3

2 June 2007 at 9:55pm
Never mind....
SilverStripe is too mighty!!
<ul id="nav">
<% control Menu(1) %>
<li class="$LinkingMode<% if FirstLast %> $FirstLast<% end_if %><% if Children %> expand<% end_if %>" accesskey="$Pos">
<a href="$Link" title="$MenuTitle">$MenuTitle</a>
<% if Children %>
<ul class="Menu2">
<% control Children %>
<li class="$LinkingMode<% if FirstLast %> $FirstLast<% end_if %>">
<a href="$Link" title="$MenuTitle">$MenuTitle</a>
</li>
<% end_control %>
</ul>
<% end_if %>
</li>
<% end_control %>
</ul> -
Re: Problem with Poll in tutorial 3

2 June 2007 at 10:07pm Last edited: 2 June 2007 10:08pm
That's exactly how you do it.
Also, if you only want the children pages to show when you're on the section, just add <% if LinkOrSection = section %> inside your <% if Children %>.
Cheers,
Sean
| 1654 Views | ||
|
Page:
1
|
Go to Top |



