Add a single page

Permalink
Hello,

I cannot get a single page to work. I want the single page to take over the blocks form the main page. I can't find good documentation on this. As I see it now, in my theme- folder, I should add view.php for single pages. Should there be different code in there than default.php?

pixel
 
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
If you want to have the single pages take on your theme style instead of the grey concrete style you need to edit your /root/config/site_theme_paths.php file like this
?php  
defined('C5_EXECUTE') or die(_("Access Denied."));
$v = View::getInstance();
$v->setThemeByPath('/login', "YourThemeName"); 
$v->setThemeByPath('/403', "YourThemeName");
$v->setThemeByPath('/register', "YourThemeName");
$v->setThemeByPath('/download_file', "YourThemeName");
$v->setThemeByPath('/install', "YourThemeName");
$v->setThemeByPath('/maintenance_mode', "YourThemeName");
$v->setThemeByPath('/members', "YourThemeName");
$v->setThemeByPath('/page_forbidden', "YourThemeName");
$v->setThemeByPath('/upgrade', "YourThemeName");
$v->setThemeByPath('/maintenance_mode', "YourThemeName");
$v->setThemeByPath('/page_not_found', "YourThemeName");
$v->setThemeByPath('/user_error', "YourThemeName");

Change the "YourThemeName" to the name of your theme including the "",
If your theme is called greensalad then replace "YourThemeName" with "greensalad"
Then copy all of those single pages from root/concrete/single_pages folder to root/single_pages folder,
This will allow you to tweak the single pages without them being overwritten by a future upgrade,
xaritas replied on at Permalink Reply
I'm not sure what you mean by "take over the blocks from the main page," but view.php differs from default.php in this respect, for view.php to do its job, you need to have the following code:
<?php print $innerContent ?>


This emits whatever the single page's output is. As such, it should come after the top parts of your page, and before the bottom parts.