Understanding Single Pages in Packages (how to install theme specific single page)
"If you need more flexible control over a single page within a particular theme, just include a file with the same name as your single page within the theme itself.
That entirely file will be used as the single pages template, including the header, footer, etc... It can completely override the single page, too.
(So, in our example above, once we have "my_profile" added as a single page, add "my_profile.php" to your active theme. This template will then be used instead of the single page." - c5 docs
So how do you do this from within the package's controller file?
Here is the code I'm using to create the single page:
//myPackage/controller.php Loader::model('single_page'); $sp = SinglePage::add('/style_guide', $pkg); $sp->update(array('cName'=>t("Style Guide"), 'cDescription'=>t("Site design style guide.")));
This newly created single page will only be picked up when I manually copy the single page file, in this case "style_guide", into the root/single_pages/ directory.
I've found some info here (filed under bugs?):
, but at this point I'm a little confused as to how to work with single_pages that are "theme specific" since in testing in order for the theme specific single_page to be picked up by c5 I had to always copy the file first to the root/single_pages/ directory... for some reason it won't work without a file in there first... then an over-ride file placed in the theme folder with the same name.
The funny thing is, once c5 makes the link to the over-ride file in the theme folder the root/single_pages/ file is no longer needed and can be deleted. Would be nice to eliminate this step of manually copying the file over just to install the "over-ride" version of it stuffed in my theme folder... but since wishing in one hand pretty much produces ... well, we know what in the other...
...so I guess my question is, can you install a theme specific single page from within the package installer and if so, any suggestions as to how :)
Root Level Single Page (installs correctly)
Theme Specific Single Page (no workie)
... so this leads me to believe that "theme specific" single pages are not supported in packages?
I am having a similar issue.
I've created a single page inside my theme controller like so:
$sp = SinglePage::add('/work', $this); $sp->update(array('cName'=>t('Work'), 'cDescription'=>t('Present all work')));
($this refers to the theme handle)
Now I got no clue where the controller file for it is supposed to go, no matter where i put it it doesnt get picked up.
ODDDLY ENOUGH tho when i create a single page called "/dashboard/blabla" for the DASHBOARD inside my theme it works all perfectly fine!
The controller can be found inside
The view can be found inside
This is so strange!
File C:/xampp/htdocs/xxx/concrete5/packages/theme_addiction/themes/xxx/default.php not found. All themes need default.php and view.php files in them. Consult concrete5 documentation on how to create these files.
Solution: It was a caching issue! I had to go to dashboard -> single pages and hit the "refresh" button next to the single page.