Using block in single pages.

Permalink 1 user found helpful
Hi can anyone tell me how to use a block in a single page? ive created a single page from the c5 tutorial but as far as i know all the editing you do with a single page isnt through the cms, its on your own with a text editor (or so i think). i am using js page slide and trying to have the form "slide out". the sliding form page is a single page. can anyone tell me the best way to go about this?

thanks in advance
joseph

lifesgood1984
 
JohntheFish replied on at Permalink Reply
JohntheFish
You have to edit the theme's view.php and put in a couple of lines of php for an area above or below the single page line. For example, to have a 'Main' area beneath the single page content:

// existing single page content line
print $innerContent;
// inserted lines for Main area
$a = new Area('Main');
$a->display($c);
lifesgood1984 replied on at Permalink Reply
lifesgood1984
thanks for the fast reply john! Another question: how do i actually place the block in the single page? i should have mentioned that my view.php doesnt load the header or footer because im using it for js pageslide. the js conflicts with the header already loaded when the page slides out so i had to take the header out the single page which is fine because it wouldnt fit the design anyway. im working under the assumption that i need that 'loader:header_required' to bring the editing bar up. is there a way to call the editor without having to include my header? do u kinda get what im saying? lol thanks in advance
JohntheFish replied on at Permalink Reply
JohntheFish
I have not found a need to try a special case for the header yet, so don't have a clue what the nasty side effects of this could be (I am sure there are others who have a better idea what is going on than I do) - at a guess, you could try:

// First do common header stuff for edit and normal view
if ($c->isEditMode()){
   // Stuff specific to edit mode
}
else {
   // Whatever you need to put in that you left out in edit
}


There is a javascript equivalent you can use to do similar in the browser.
if (CCM_EDIT_MODE){
    // edit mode javascript stuff
}
else {
    // non-edit mode javascript stuff
}