How do you edit a Designer Content block?

Permalink Browser Info Environment
Hi There,

We've made a designer content block but now the client want's to change on of the fields to an image field.

Sorry if this is simple but we can't figure it out - how do you do edit a Designer Content block?

Cheers

Ben

Type: Discussion
Status: In Progress
cmscss
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
You can't edit blocks from the dashboard interface, but you can edit the block's code directly (you'll need a bit of php know-how to do this). The block is located in your site's top-level "blocks" directory (NOT in concrete/blocks, and NOT in packages/designer_content/blocks), and will be named with the handle you entered when you created the block.

-Jordan
cmscss replied on at Permalink Reply
cmscss
Thanks mate - will have a go.
cmscss replied on at Permalink Reply
cmscss
So I guess I need to change it in a couple of places right?
- The entry template (is that called edit.php?)
- The output template

Is there anything that needs to be done in the database?

And can I just copy and paste code from a different image and rename it?
jordanlev replied on at Permalink Reply
jordanlev
Depends on which kind of field(s) you want to add -- you might need to alter every file. If you're not familiar with how C5 blocks work, it might be a bit complicated, but in general you need to modify these files:
edit.php -- the block edit form that users enter content into
view.php -- the template that displays the block html out on the page
db.xml -- the database schema definition containing all the fields
controller.php -- most of the functional code, basically does data preparation so the view.php file doesn't have to have a bunch of ugly code in it

How much content has already been entered with this custom block? It might be easier to create a new block and transfer everything over to that.
imran replied on at Permalink Reply
imran
Hi, I have created a block on Designer content package, which have a WYSIWYG editor, which work perfectly but the block in edit mode create new record in database i.e: not replace the existing record which i want to edit/update.

So what to do with this problem. Thanks.
jordanlev replied on at Permalink Reply
jordanlev
I believe this was addressed in another forum thread:
http://www.concrete5.org/community/forums/customizing_c5/check-it-o...
MrLindau replied on at Permalink Reply
MrLindau
I like this a lot, and I will have good use of it for most of my clients. But do you have any plans of making an "edit block" function?

Best regards
Fredrik
jordanlev replied on at Permalink Reply
jordanlev
No, I have no plans for this -- you will need to modify the generated block's code as described above.

Implementing a dashboard interface for editing existing block types is an order of magnitude more complicated than creating them in the first place, and I don't see the benefit being worth the immense amount of work involved (especially since there already is a way to achieve this -- by working with the code directly).

Sorry.

-Jordan
MrLindau replied on at Permalink Reply
MrLindau
No worries =)

I was just curious.

Thanks for the fast reply!
ClickAccount replied on at Permalink Reply
ClickAccount
Thanks - this helped me tremendously!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.