Home Controller
Permalink
Hi guys,
I'm pretty new in concrete5 (I really like it compared to some CMSs) and I have a little question , here it is : I understood how concrete's controllers are working but when I try to create a controller for the home page it won't use the view function in my HomeController class
Here is the folder structure : Application/page_types/home.php and the class also extends the PageTypeController.
I'm pretty sure I'm missing something but what ? Could you help me please ?
Thank you !
I'm pretty new in concrete5 (I really like it compared to some CMSs) and I have a little question , here it is : I understood how concrete's controllers are working but when I try to create a controller for the home page it won't use the view function in my HomeController class
Here is the folder structure : Application/page_types/home.php and the class also extends the PageTypeController.
I'm pretty sure I'm missing something but what ? Could you help me please ?
Thank you !
If you are using the default Elemental theme with sample content, the home page does not have a page type and uses the "Full" page template. To control the home page using a page type controller, it first needs to be assigned a page type.
1. create the "Home" page type
Dashboard> Pages & Themes> Page Types
- the page type handle will be "home"
2. create the Home page type controller
application/controllers/page_types/home.php
- the name of the file is the page type handle - "home.php"
- camelcase the page type handle for the name of the class - "Home"
3. in the sitemap, click on the Home page and select "Design & Type" from the popup menu.
4. In the Design & Type modal, select "Home" from the Page Type drop-down select
After following these steps, the page type controller will now work with the home page. You can test it out by putting dd('page type controller test message') in the controller view method. The dd() method is a combination of die() and var_dump() and will exit the page when the view() method is fired.