Package Overrides?

Permalink 1 user found helpful
Can anyone give me a definitive answer on this one?

I became more motivated to find out how this works after I discovered the package update system deletes the package as it's installing a new one - so if you've hastily edited something in a block that's part of a package, be it just some css or perhaps view.php and then upgrade the package... poof!

I've had some success with concrete5's built-in blocks (the form, for example), but not so much with the packages.

My example uses SimpleNews. It's directory structure looks like so:

c5root/packages/simplenews/blocks/news_list/templates/foo/view.php|view.css

In the "templates" directory are two stock templates for displaying a block of news on a page. I made my own and dropped it in there and it works fine (we'll call it "foo" and put "view.php" and "view.css" in there).

I then made the following directory:

c5root/blocks/simplenews/blocks/news_list/templates/foo/

...and dropped my view.* files in there and deleted the directory under the package's own theme directory. No sign of my custom template.

I tried similar things with other packages with no luck - mostly just looking to override a block's css without having to jam a bunch of "!important" tags in my main css file.

Am I misunderstanding how the local overrides are supposed to work? They seem to work great for the c5 built-ins...

spork
 
Shotster replied on at Permalink Reply
Shotster
> Am I misunderstanding how the local overrides
> are supposed to work? They seem to work great
> for the c5 built-ins...

You might want to check out this thread...

http://www.concrete5.org/community/forums/customizing_c5/blocks-chi...

Some of these override issues have supposedly been addressed in the upcoming 5.4.1 release.

-Steve
Mnkras replied on at Permalink Reply
Mnkras
here is the "priorities" in c5
lowest priority -> highest
/concrete directory -> /packages directory -> /blocks directory

so for example with simple news,
its in /packages/simple_news/blocks/simple_news/
<example>

you can stick a view file in /blocks/simple_news/templates, and even if you upgrade the page its still there
jgaris replied on at Permalink Reply
Is it possible to override a packages files with another package. For example I am building some "enhancements" to the ecommerce package. Currently I can do that directly to our install, but if I wanted to package it as an add-on, would it work?
andrew replied on at Permalink Reply
andrew
This should work, you've just created the directory structure slightly wrong:

Instead of this:


c5root/blocks/simplenews/blocks/news_list/templates/foo/

Make it this:


c5root/blocks/news_list/templates/foo/

Once you're in the local directories you don't need to reference the packages anymore.
spork replied on at Permalink Reply
spork
That did it for me, thanks so much!