# Combining CKEditor field and other input fields

**URL:** https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417
**Category:** Developing with Concrete
**Created:** [April 19, 2023, 9:10pm UTC](https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417 "2023-04-19T21:10:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ntisithoj](https://forums.concretecms.org/user_avatar/forums.concretecms.org/ntisithoj/32/2950_2.png) [@ntisithoj](https://forums.concretecms.org/u/ntisithoj)
#### Post date: [April 19, 2023, 9:10pm UTC](https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417/1 "2023-04-19T21:10:10Z")

</div>

I am trying to create a block that has typical form input fields _and_ a CKEditor field as well, i.e., I want $content to be just another field in the table that has other fields as well. I tried various attempts, including trying to add input fields to the existing content block, but nothing works 😕

How can I add a new field to the content block?

---

<div class="post-metadata">

### Author: ![hutman](https://forums.concretecms.org/user_avatar/forums.concretecms.org/hutman/32/6198_2.png) [@hutman](https://forums.concretecms.org/u/hutman)
#### Post date: [April 20, 2023, 3:09pm UTC](https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417/2 "2023-04-20T15:09:17Z")

</div>

If you make a custom block you can use this code to add a WYSIWYG editor to the edit.php

```auto
<?php echoCore::make("editor")->outputStandardEditor('content', $content); ?>

```

I would not recommend adding a new field to the actual content block, but if you really want to do that you’ll need to copy the whole concrete/blocks/content directory into application/blocks and make your changes there. You will need to add more fields to the database so you’ll have to refresh the block type after you update the db.xml and the rest of the files.

---

<div class="post-metadata">

### Author: ![mnakalay](https://forums.concretecms.org/user_avatar/forums.concretecms.org/mnakalay/32/6276_2.png) [@mnakalay](https://forums.concretecms.org/u/mnakalay)
#### Post date: [April 20, 2023, 11:36pm UTC](https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417/3 "2023-04-20T23:36:35Z")

</div>

Why not simply use a form block?

If you add a Textarea to it, you have the choice between Plain text or Rich text (CKeditor)

---

<div class="post-metadata">

### Author: ![ntisithoj](https://forums.concretecms.org/user_avatar/forums.concretecms.org/ntisithoj/32/2950_2.png) [@ntisithoj](https://forums.concretecms.org/u/ntisithoj)
#### Post date: [April 21, 2023, 3:50am UTC](https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417/4 "2023-04-21T03:50:11Z")

</div>

wow! I can’t believe it’s that easy, esp after the work I lost trying to make it work. Thanks… works perfectly!

---

<div class="post-metadata">

### Author: ![hutman](https://forums.concretecms.org/user_avatar/forums.concretecms.org/hutman/32/6198_2.png) [@hutman](https://forums.concretecms.org/u/hutman)
#### Post date: [April 21, 2023, 1:37pm UTC](https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417/6 "2023-04-21T13:37:09Z")

</div>

Make sure you check the LikeAbstractor stuff from the Content block to make sure you’re saving/displaying the information correctly.

---

<div class="post-metadata">

### Author: ![ntisithoj](https://forums.concretecms.org/user_avatar/forums.concretecms.org/ntisithoj/32/2950_2.png) [@ntisithoj](https://forums.concretecms.org/u/ntisithoj)
#### Post date: [April 21, 2023, 2:17pm UTC](https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417/7 "2023-04-21T14:17:20Z")

</div>

(You mean LinkAbstractor) and by “check” do you mean to make sure I am using Concrete\Core\Editor\LinkAbstractor ??

---

<div class="post-metadata">

### Author: ![hutman](https://forums.concretecms.org/user_avatar/forums.concretecms.org/hutman/32/6198_2.png) [@hutman](https://forums.concretecms.org/u/hutman)
#### Post date: [April 21, 2023, 2:31pm UTC](https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417/8 "2023-04-21T14:31:29Z")

</div>

Yes, make sure you use the translateTo, translateFrom, and translateFromEditMode functions appropriately.

---

<div class="post-metadata">

### Author: ![ntisithoj](https://forums.concretecms.org/user_avatar/forums.concretecms.org/ntisithoj/32/2950_2.png) [@ntisithoj](https://forums.concretecms.org/u/ntisithoj)
#### Post date: [April 21, 2023, 3:33pm UTC](https://forums.concretecms.org/t/combining-ckeditor-field-and-other-input-fields/5417/9 "2023-04-21T15:33:00Z")

</div>

hmm… so, I need to add

```auto
public function getContent() {
        return LinkAbstractor::translateFrom($this->content);
}
 public function getContentEditMode() {
        return LinkAbstractor::translateFromEditMode($this->content);
}

```

to my block’s controller? And if so, do I also need to add all the other functions I see in the content block controller, like

```auto
public function getImportData($blockNode, $page)...
public function export(\SimpleXMLElement $blockNode)...
public function getUsedFiles()...

```

etc?
