Override package files

Permalink
Hi,
Is there a way to add or edit a file at a package without loosing it after update package?

shahroq
 
hutman replied on at Permalink Reply
hutman
You can override a package file just like you do a core file. Are you working with 5.6 or 5.7? What file(s) are you trying to override?
shahroq replied on at Permalink Reply
shahroq
I don't think it's possible to override a package dashboard or block controller like others. As a sign there is not a "package" folder inside /application/ folder. Also i created one and test it.
My question was about both 5.7 and 5.6, but specifically i tried it for 5.7.
hutman replied on at Permalink Reply
hutman
In 5.6 what you would do is re-create the same file in the root folders. So if you had /packages/sample_package/controllers/dashboard/sample_package/search.php you would create /controllers/dashboard/sample_package/search.php
drbiskit replied on at Permalink Reply
drbiskit
I am having a similar issue currently on a 5.6.3.4 site...

I have this package file:
root/packages/package_name/models/example.php

I've copied it to:
root/models/example.php

+ nothing happens.

Any ideas?

UPDATE:

Fixed. Caching. doh.
Dushka replied on at Permalink Reply
Dushka
I am still very confused. I have read just about everything I can about over-riding, but all the information seems to be directed towards developers who want to over-ride core files in the packages they are creating. I am just a user who wants to tweak a css file and not lose the changes when the package is updated. Here is the path of a package css file I would like to tweak (I'm using version 5.7):

\concrete\packages\jb_megamenu\blocks\jb_megamenu\css\skins\blue.css

Could someone please give me the FULL PATH where I should put "blue.css" for the purpose of making changes.

Do I need to make any changes in any other files to make this work? If anybody can explain this in really simple times they will earn my undying gratitude.
drbiskit replied on at Permalink Reply
drbiskit
Hi Dushka - I think your package should be here:

root/packages/jb_megamenu/blocks/jb_megamenu/css/skins/blue.css

and not:
root/concrete/packages/jb_megamenu/blocks/jb_megamenu/css/skins/blue.css

==

And then to override the CSS file, place your custom copy here:
root/application/blocks/jb_megamenu/css/skins/blue.css

Clear your cache + that should do the trick.
Dushka replied on at Permalink Reply
Dushka
Hello, drbiskit. Many thanks for your response.

I apologize. I got myself confused there. So yes, the path is, as you say it should be, root/packages/jb_megamenu......etc

I have tried doing as you say, but it's not having any effect. I'm sure I'm doing something very obvious very wrong, but I'll be a monkey's uncle if I can figure it out. I'll keep trying.

I have had a look athttp://documentation.concrete5.org/tutorials/override-almost-any-co... It's rather all Greek to me, but In there it makes mention of an "Override Class Name". I'm wondering if that has any significance for my problem.
Dushka replied on at Permalink Reply
Dushka
Just an additional point.

If I copy the entire set of files and folders under jb_megamenu to the applications/blocks directory and then clear the cache, I get a full-screen error message headed "Class '\Application\Block\JbMegamenu\Controller' not found ".

From this fact I deduce that,
1/ I'm putting them in the right place and
2/ something else needs to be changed, perhaps in jb_megamenu/controller.php

Wish I understood the coding side of things a whole lot better.
drbiskit replied on at Permalink Reply
drbiskit
Hi Dushka -

You wouldn't need to place the entire file set to the blocks directory - just the part that deals with the actual block, and in your case, the only actual file that you need to include is the .css file that you want to override - It just neds to be in the correct directory structure.

If you were willing to PM me with access details to your site(for FTP + concrete install), I could logon and take a look?

Rich.
Dushka replied on at Permalink Reply
Dushka
Thanks, Rich. That narrows finding the solution down.

Many thanks for your kind offer. I will definitely keep it in mind. Let me play around a bit more first with some other packages.

Rod

-----Original Message-----
From: concrete5 Community [mailto:discussions@concretecms.com]
Sent: Thursday, 24 March 2016 8:04 PM
To: rod.mcqueen@iinet.net.au
Subject: Override package files : Chit-Chat