Override/Extend /concrete/core/controllers/blocks/pagelist.php to root
Permalink
Hello,
I needed to add this code in pagelist.php (function getPages()) file to be able to filter pageslists by attribute tags.
The problem is that I am editing a file from the core:
/concrete/core/controllers/blocks/pagelist.php
How can i override/extend this file to the root? I tried to put in the root folder controller the but without success
Thanks,
Tiago Valverde
I needed to add this code in pagelist.php (function getPages()) file to be able to filter pageslists by attribute tags.
if (isset($_GET['mytag'])) { $pl->filterByAttribute('tags', "%\n{$_GET[mytag]}\n%", "like"); }
The problem is that I am editing a file from the core:
/concrete/core/controllers/blocks/pagelist.php
How can i override/extend this file to the root? I tried to put in the root folder controller the but without success
Thanks,
Tiago Valverde
Hi JohnTheFish,
Thanks for the links, it helped me understanding better the blocks customization and the core files overriding.
The problem was that i tried to override the controller file /concrete/core/controllers/blocks/pagelist.php but the file was already extended by the file /concrete/blocks/page_list/controller.php.
I copy the controller.php file to /blocks/page_list/ and added the function that i edited and it worked.
Best regards,
Tiago Valverde
Thanks for the links, it helped me understanding better the blocks customization and the core files overriding.
The problem was that i tried to override the controller file /concrete/core/controllers/blocks/pagelist.php but the file was already extended by the file /concrete/blocks/page_list/controller.php.
I copy the controller.php file to /blocks/page_list/ and added the function that i edited and it worked.
Best regards,
Tiago Valverde
In 5.6+, you need to extend the class that starts core.... in the same way that the block does.
http://www.concrete5.org/documentation/how-tos/designers/change-how...
and
http://www.concrete5.org/documentation/how-tos/developers/change-th...