Collections and Single Pages

Permalink
Hi,

I am completely new to concrete5 but quite experienced with php. I was recently tasked with assigning a theme to a single page, which I have accomplished through the use of view.php. However, the theme template uses Areas and collections (eg. $a = new Area("Main Content"); $a->display($c);) to display parts of the template. These snippets do not produce any html when the site is rendered, so the final page is missing pieces (like the main nav). I have no idea why it should work for regular pages, but not for single pages, but I'm guessing it's a simple fix. Can anyone help me?

Thanks

 
Mnkras replied on at Permalink Reply
Mnkras
unfortunately, there is no "single page defaults" page, you will have to add it manually
UnSaniT replied on at Permalink Reply
Keeping in mind that I don't know anything about c5, I'm not sure how to do that.

I have the view.php which is basically the same as one of the template php scripts. It's just that the $a->display($c) doesn't produce any html for the single page.

I'm assuming it's because $c isn't being initialized properly. I'm happy to do that manually, but I'm not sure how. Is there some relevant code I can copy into view.php?
Mnkras replied on at Permalink Reply
Mnkras
you add things like the nav through the CMS, go to the page, put it in edit mode and add it
UnSaniT replied on at Permalink Reply
it is the /login page. When I go to the page, the edit box (in top corner) is not there?
pixel8 replied on at Permalink Reply
pixel8
the login page is kinda specific and not directly editable within C5 - this you have to do by hardcoding it to the login.php file... you will find the file here:

your_site_folder/concrete5/single_pages/login.php

copy that file into:

your_site_folder/single_pages/


now, you can edit all you want in that file - and if something goes very wrong, you can just delete the file, and the standard login page is shown....

just remember to copy the file into your_site_folder/single_pages to make sure you don't mess with the core file!

Hope that helps!
UnSaniT replied on at Permalink Reply
That does help, but I am still not sure how to hardcode it. It is using this view.php file to be printed as the $innerContent. So really there are these blocks in view.php that aren't being displayed. So I should edit view.php, I assume. But I don't know which blocks to load, nor how to load them.

Is there some way I can look at some code for other pages and copy it? Or can someone explain how to determine which blocks to load, and then how to load them manually?
I assume it is one block per $a->display($c)

The display method sort of confuses me a little bit. If you have several blocks loaded into $c, and you call $a->display($c), does it only display the certain block corresponding to the area name?

Thanks