C5 Database Schema

Permalink
I am looking for documentation on the db schema for tables / relations for c5. I need to move around a block and I am using the add on block splitter and it is not letting me move a "non" split block. I am very comfortable with sql, so I have no problem updating the db, but I am not sure what table(s) to update to move the blocks around.

Any ideas?

globalnerds
 
mkly replied on at Permalink Reply
mkly
Typically, trying to get stuff done with concrete5 and direct interaction with the database leads to sadness.

But you are indeed in luck because the concrete5 Block interface allows you to move a block. All you need to do is make yourself a soup of 1 Block, 1 Page, and 1 Area.

/**
 * 1st lets grab the block
 * Change 7 to your blocks ID
 * Or this might just be in a foreach loop etc
 */
$block = Block::getByID(7);
/**
 * Ok, we have the block
 * Great, let's get a destination page
 * Again with the 7 part, change as needed
 */
$page = Page::getByID(7);
/**
 * Ok, almost there
 * Let's set a destination Area


Hope that helps out with doing it the concrete5 way.

On top of that, you can always create a temporary file in the /tools directory and place your script there and call it with
http://www.example.org/index.php/tools/myscript

Replace the example.org and note that myscript doesn't have the php, but the actual file in the /tools directory needs the .php

Also, be sure to disable your Overrides Cache while doing this.

The big perk of launching scripts from the tools directory is that you get all the concrete5 bootstrapping and autoloaders all set up for you already.

Best Wishes,
Mike