Yes, now. Startpage has a unique template and displays only a special sidebar plugin. The links to the other subpages and the link to display an blog-entry are not working properly.The plugin-unsetting is only available in serendipity 0.9, I forgot to mention. You are using that, right?
Here is my code. Beginning with the event_hook function:
Code: Select all
function event_hook($event, &$bag, &$eventData, $addData = null) {
global $serendipity;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
switch ($event) {
case 'genpage':
$args = implode('/', serendipity_getUriArguments($eventData, true));
if ($serendipity['rewrite'] != 'none') {
$nice_url = $serendipity['serendipityHTTPPath'] . $args;
} else {
$nice_url = $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?/' . $args;
}
if ((empty($args) || trim($args) == $serendipity['indexFile']) && (empty($serendipity['GET']['subpage']) || $serendipity['GET']['subpage'] == $nice_url)) {
$serendipity['GET']['custompage'] = 'customstart';
$serendipity['template'] = 'royal'; // HANNO: Insert your template name for the startpage here.
} else {
print_r($nice_url);
print_r($args);
print_r($serendipity['indexFile']);
print_r($serendipity['GET']);
die('You did not simply call the startpage, but supplied GET parameters to the page. Serendipity does not recognize this as your startpage.');
}
break;
case 'frontend_generate_plugins':
$plugins =& $eventData;
if ($serendipity['GET']['custompage'] != 'customstart') {
return false;
}
foreach ($plugins as $idx => $plugin_data) {
// HANNO: Insert the name of the single plugin you want to keep here.
if ($plugin_data['name'] != '@serendipity_archives_plugin:13c33ce69xxxxxx') {
unset($plugins[$idx]);
}
}
break;
default:
return false;
break;
}
} else {
return false;
}
}
Hannes