Overriding package files in Concrete 5.7
Permalink
Hi.
I have Concrete 5.7.5.13 installed. Now, in one of the packages I also have added to the system I want to modify one of it's files, but I want to make it in such a way that the package updates will not remove my changes.
After reading through the community site and searching on the internet I find no answers to how this is done properly. The closest thing I can find is that I should add the file and it's directory strucure from the /package directory to the /application directory. However I still cannot get C5t to pick up my changes.
Specifically I am trying to override this file:
/packages/mypackage/blocks/page_list/templates/mylist/view.php
I have done that by placing the updated file here:
/application/blocks/mypackage/page_list/templates/mylist/view.php
Am I using the right paths here, or have I missed something?
I have Concrete 5.7.5.13 installed. Now, in one of the packages I also have added to the system I want to modify one of it's files, but I want to make it in such a way that the package updates will not remove my changes.
After reading through the community site and searching on the internet I find no answers to how this is done properly. The closest thing I can find is that I should add the file and it's directory strucure from the /package directory to the /application directory. However I still cannot get C5t to pick up my changes.
Specifically I am trying to override this file:
/packages/mypackage/blocks/page_list/templates/mylist/view.php
I have done that by placing the updated file here:
/application/blocks/mypackage/page_list/templates/mylist/view.php
Am I using the right paths here, or have I missed something?
I forgot to mention, I have turned off all caching and deleted the cache.
The file path should be /application/blocks/page_list/templates/mylist/view.php
Thanks, that worked out nicely!
So, is there a description somewhere for override namingstandards or is it as simple as you can override anything in /packages by copying everything under a package say /package/packagename/blocks/*, /package/packagename/languages/* and so on and just place them in /application/blocks/* and /application/languages/* ?
WIll there not potentially be sort of a naming clash if you do not bring the package name with you in the directory structure?
I also want to add an extra norwegian language translation to this package (that will not be removed during the next package update). If I follow what seems to be the naming standard above I should add the file and directory structure like this: /application/languages/nb_NO/LC_MESSAGES/messages.mo, but there is already a norwegian language file in that structure. Are package language overrides/additions placed in a different place?
So, is there a description somewhere for override namingstandards or is it as simple as you can override anything in /packages by copying everything under a package say /package/packagename/blocks/*, /package/packagename/languages/* and so on and just place them in /application/blocks/* and /application/languages/* ?
WIll there not potentially be sort of a naming clash if you do not bring the package name with you in the directory structure?
I also want to add an extra norwegian language translation to this package (that will not be removed during the next package update). If I follow what seems to be the naming standard above I should add the file and directory structure like this: /application/languages/nb_NO/LC_MESSAGES/messages.mo, but there is already a norwegian language file in that structure. Are package language overrides/additions placed in a different place?
Packages are a way of wrapping or "packaging" various items (blocks, themes. and more) for installation and uninstalling. Whatever you are actually over-riding is what goes into the application folder, and you recreate the same path there. So above it was a template for the core page list block. Perhaps a little confusing only because packages can do the same thing as the application folder does. So for example the main 3 places you might find a template for a core block are
/concrete/blocks/page_list/templates/onetemplate/view.php
/application/blocks/page_list/templates/anothertemplate/view.php
/somepackagename/blocks/page_list/templates/yetanothertemplate/view.php
Read more here
https://documentation.concrete5.org/developers/working-with-blocks/w...
Hope that helps.
Somebody else is going to have to answer your translations questions though because I don't know.
/concrete/blocks/page_list/templates/onetemplate/view.php
/application/blocks/page_list/templates/anothertemplate/view.php
/somepackagename/blocks/page_list/templates/yetanothertemplate/view.php
Read more here
https://documentation.concrete5.org/developers/working-with-blocks/w...
Hope that helps.
Somebody else is going to have to answer your translations questions though because I don't know.
Thanks, I got it working now.