Hello Howard.
Thnx for your reply.
This is exactly what I want, but it's still not working.
First I tried this
I created the page mysite/code/SplashPage.php
<?php
class SplashPage extends SiteTree {
public static $db = array(
);
public static $has_one = array(
);
}
class SplashPage_Controller extends ContentController {
/**
* An array of actions that can be accessed via a request. Each array element should be an action name, and the
* permissions or conditions required to allow the user to access it.
*
* <code>
* array (
* 'action', // anyone can access this action
* 'action' => true, // same as above
* 'action' => 'ADMIN', // you must have ADMIN permissions to access this action
* 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true
* );
* </code>
*
* @var array
*/
public static $allowed_actions = array (
);
public function init() {
parent::init();
// Note: you should use SS template require tags inside your templates
// instead of putting Requirements calls here. However these are
// included so that our older themes still work
Requirements::themedCSS('layout');
Requirements::themedCSS('typography');
Requirements::themedCSS('form');
}
}
function NextPage()
{
if (isset($_GET['nextPage'])) {
return DataObject::get_by_id('Page', $_GET['nextPage']);
}
}
And the templates
/themes/blackcandy/templates/SplashPage.ss
and
themes/blackcandy/templates/Layout/SplashPage.ss
In the last template there is this code:
<a href="$NextPage.Link"> $NextPage.Title </a>
Flush the page, but...
This didn't worked out, so I deleted this
function NextPage()
{
if (isset($_GET['nextPage'])) {
return DataObject::get_by_id('Page', $_GET['nextPage']);
}
}
from mysite/code/SplashPage.php and created this foder /mysite/code/Controllers/ with the page SplashPage.php
<?php
function NextPage()
{
if (isset($_GET['nextPage'])) {
return DataObject::get_by_id('Page', $_GET['nextPage']);
}
}
?>
But now I have no idea how to activate this Controllers php file from the _config file.
Please help, thank You!
Marnix