Overridding Controller.php as well as the add.php and edit.php

Permalink
Hello,

I'm overriding C5's Page List Block to create custom templates. Moreover, I'm adding additional functionality to the controller.php.

I've learned how to override Concrete5's core blocks by adding similar files to the application>blocks directory and then creating >templates>of_my_own_creation.php.

Next, overriding the controller.php, was fairly straight forward, by using the same controller.php and modifying the namespace and referencing the core block controller, ie:
namespace Application\Block\PageList; 
use Concrete\Block\PageList\Controller as PageListBlockController;
use someThing here;
use moreStuff\here;
class Controller extends PageListBlockController
{
pulic function myEditsBelow....()
}


Now I need to modify the editing interface to add more functionality. It appears I could accomplish by modifying the page_list_form.php. However, simply having this file located in the applicaton>blocks>page_list directory does not override the file like I was hoping. I found the add.php and edit.php seem to control what file is called for this interface but adding the add.php and edit.php to the applicaton>blocks>page_list directory also does not override core files.

How do I override the add.php and edit.php? Do I even need to override these files to edit the page_list_form.php, or is there another way?

haundavid
 
mnakalay replied on at Permalink Reply
mnakalay
Hello.
I would suggest a different approach.
Since you are overriding pretty much everything in that block, I suggest you change its handle to something else and just have it as a whole new custom block type. That will certainly fix the add/edit issue.