Correct way to intall a package/sample content?

Permalink
So we have a package that containts blocks and a theme. We also want to bundle it with sample content, however this is causing a lot of problems.

The blocks/themes install fine, if done so via an already-installed C5 site. However if you try to install the demo content it throws all sorts of errors.

After hours of headaches it seems the problem lies with the fact it doesn't seem to install/activate blocks/themes correctly so when it comes to installing the demo content it's trying to insert fields that simply don't exist.

So, for example, we've modified date_nav and added a field. However when trying to install sample content that field doesn't exist as the block hasn't been updated.

Any ideas?

 
PineCreativeLabs replied on at Permalink Reply
PineCreativeLabs
I am working on something similar to this as well. I found a free addon that might help with this:

http://www.concrete5.org/marketplace/addons/sample-content-generato...

Otherwise, I could make a demo package that does this.
designedbydash replied on at Permalink Reply
Hey,

Thanks for the reply, I am using that tool to generate the content.xml file but it just doesn't work.

It fails with a variety of errors (depending how I play with it) but the most common one is:

"Fatal error: Call to a member function getController() on a non-object in /concrete/core/libraries/content/importer.php on line 212"

Which is something to do with blocks/areas in that file, which I am assuming is because the blocks/themes are not installed so it can't install that data as the tables don't exist. However, I just can't work out how to get it to install the theme/blocks during the install process which I hope will fix it.
designedbydash replied on at Permalink Reply
I've narrowed it down a little more, I'm so close. By not using a package and placing the files in their respective folders in the root (so /themes/ and /blocks/) it mostly works.

It installs the theme, and it installs the blocks. The only problem is I've modified some blocks in my package and the DB schema hasn't been updated so when it tries to import the content those fields don't exist. Any ideas?
mhawke replied on at Permalink Reply
mhawke
If you are not installing your custom blocks inside your package folder, are you over-writing the core?

Have a look at the packages that already exist for clues as to how to build them properly. Lots of them have installed blocks inside the package folder. Look through the package-level controller for how to do that.

This might help:

http://www.altinkonline.nl/tutorials/concrete5/make-a-concrete5-pac...