Override core/controllers/blocks/content
Permalink
I try now for hours and it just doesn't work, hope someone can help me out.
I use 5.6.0.2 (upgraded) and all I want is to override the controller of the content block.
I tried a lot, but I think this should actually work:
creating [root]/blocks/content/controller.php and copy the content of the [root]/updates/concrete5.6.0.2/core/controllers/blocks/content.php into it and change it.
But that didn't do a thing. Do I need to make this changes in the folder of the update? E.g in [root]/updates/concrete5.6.0.2/blocks/content/controller.php or what do I do wrong?
I use 5.6.0.2 (upgraded) and all I want is to override the controller of the content block.
I tried a lot, but I think this should actually work:
creating [root]/blocks/content/controller.php and copy the content of the [root]/updates/concrete5.6.0.2/core/controllers/blocks/content.php into it and change it.
But that didn't do a thing. Do I need to make this changes in the folder of the update? E.g in [root]/updates/concrete5.6.0.2/blocks/content/controller.php or what do I do wrong?
Hi mnakalay and thanks for the answer.
I tried that already earlier and it didn't work. Tried it now again but it seems to change nothing. It still does not affect the file.
If I build an error into the core file I get an immediate result - it doesn't work anymore. But I can do what I want in the supposedly "override" file and I get no reaction.
Maybe something with the Cache? But I have the standard cache deactivated and if I override normal block files it works always fine.
I tried that already earlier and it didn't work. Tried it now again but it seems to change nothing. It still does not affect the file.
If I build an error into the core file I get an immediate result - it doesn't work anymore. But I can do what I want in the supposedly "override" file and I get no reaction.
Maybe something with the Cache? But I have the standard cache deactivated and if I override normal block files it works always fine.
how are you testing this?
as mnakalay mentioned, make sure you copy the almost empy controller file located at concrete/blocks/content/controller.php.
you would paste this into blocks/content/controller.php and add a function in this file, say function view(), and just do a echo 'hola'; in there to see what happens. all content blocks SHOULD now just display hola.
as mnakalay mentioned, make sure you copy the almost empy controller file located at concrete/blocks/content/controller.php.
you would paste this into blocks/content/controller.php and add a function in this file, say function view(), and just do a echo 'hola'; in there to see what happens. all content blocks SHOULD now just display hola.
I think you need to take the (mostly empty) controller from updates/concrete5.6.0.2/controllers/blocks...
Not the one from the core.
And then you take whatever function you want to modify from the core one and put it in that new file with your modifications. Or you can add your own function.