Add a "content" Block with default content into all new Pages of my PageType
Permalink
Hi,
I am very new to C5 and using 5.7.5.9.
I have created a theme with a new template (Page Type) called "FaceSlap". when the user creates a new page with Page Type "FaceSlap" I want to include a "Content" block with my default content in an Area Named "XYZ"
I have Google searched and read 100 different things, none of which have helped me.
I think I need a PageTypeController with an add() function? If so direct me to something that tells me how to create one and where it goes in the file system.
Then I still need to know how to add a block to the page.
Currently, I only have the FaceSlap.php, description.txt and thumbnail.png files in the theme/<themename> folder.
Thanks in advance,
Sean
I am very new to C5 and using 5.7.5.9.
I have created a theme with a new template (Page Type) called "FaceSlap". when the user creates a new page with Page Type "FaceSlap" I want to include a "Content" block with my default content in an Area Named "XYZ"
I have Google searched and read 100 different things, none of which have helped me.
I think I need a PageTypeController with an add() function? If so direct me to something that tells me how to create one and where it goes in the file system.
Then I still need to know how to add a block to the page.
Currently, I only have the FaceSlap.php, description.txt and thumbnail.png files in the theme/<themename> folder.
Thanks in advance,
Sean
Using the information here:https://www.concrete5.org/community/forums/customizing_c5/programmat... I was able to add the block in the <page style>.php. The trick was not to add a new block everytime the page was viewed.
In my case, I know I always want at least one content block in this area or the page is useless!
Hope that helps someone else later.