Creating a theme with new blocks

Permalink
Hi

I'm writing a theme that I want to sell on the marketplace at some point but to get my theme working with bootstrap I've created specific blocks for autonav and search, where would I need to include these for them to work when packaging it up?

I did try having a blocks folder in my theme folder but that didnt work so I had to put them in the blocks folder in the root.

designportfolio
 
tallacman replied on at Permalink Reply
tallacman
If you are making a package it would be in your "theme_package_folder" > blocks.
If you dont have it packaged yet, the best place is in the root > blocks folder.
designportfolio replied on at Permalink Reply
designportfolio
Hi

So I have

Packages
|-- <package name>
|------- themes
|------ blocks
|-- controller.php

My theme has installed but my blocks don't appear to be coming through, inside the blocks folder I have autonav and search folders to overwrite the default ones.

Do i need something extra in my controller.php?
goutnet replied on at Permalink Reply
Well actually, to do that, I think you gonna have to create a package.

and then, in your controller.php you need to install your blocktype.


within your PackageController class install method :

BlockType::installBlockTypeFromPackage( "your_block_handle", $pkg );
designportfolio replied on at Permalink Reply
designportfolio
OK so I added that in to my controller.php

But I get this error when trying to install

Warning: require_once(/var/www/test_response/concrete/blocks/blockname/controller.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/test_response/concrete/core/libraries/loader.php on line 205

Fatal error: require_once() [function.require]: Failed opening required '/var/www/test_response/concrete/blocks/blockname/controller.php' (include_path='/var/www/test_response/libraries/3rdparty:/var/www/test_response/concrete/libraries/3rdparty:.:/usr/share/pear:/usr/share/php') in /var/www/test_response/concrete/core/libraries/loader.php on line 205

I must have something set incorrectly?
goutnet replied on at Permalink Reply
Can you attach a zip file of the package you are trying to create, so I can check ?
goutnet replied on at Permalink Reply
I did not have much time to check the code but it seems you are quite messing up the structure :

check the pagehttp://www.concrete5.org/documentation/developers/system/packages...

your package should be somthing like :

- your_handle
|---themes
|   \---your-theme
\---blocks
    \--- block1
    \--- block2


etc...