# How to create an undeletable "header" node that has editable content?

**URL:** https://discuss.prosemirror.net/t/how-to-create-an-undeletable-header-node-that-has-editable-content/4046
**Category:** Uncategorized
**Created:** [September 9, 2021, 4:04pm UTC](https://discuss.prosemirror.net/t/how-to-create-an-undeletable-header-node-that-has-editable-content/4046 "2021-09-09T16:04:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ValentaTomas](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/valentatomas/32/2326_2.png) [@ValentaTomas](https://discuss.prosemirror.net/u/ValentaTomas)
#### Post date: [September 9, 2021, 4:04pm UTC](https://discuss.prosemirror.net/t/how-to-create-an-undeletable-header-node-that-has-editable-content/4046/1 "2021-09-09T16:04:22Z")

</div>

Hi,

We were trying to have a fixed “header” node in the editor, that is always the first node and has predefined fields that you can edit - like “description”, etc. The predefined fields are retrieved from the DB and the idea was that we should add the header node according to the retrieved data during the document initialization.

How can we enforce that in prosemirror? We will probably have to handle delete transactions and backspace, but I’m not sure how to keep the node always as a first node.

We are using yjs for collaboration so there may also be a problem with the always on top node when we are emerging the documents.

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)
#### Post date: [September 9, 2021, 4:17pm UTC](https://discuss.prosemirror.net/t/how-to-create-an-undeletable-header-node-that-has-editable-content/4046/2 "2021-09-09T16:17:30Z")

</div>

Have you tried making your schema require these nodes? It sounds like that should cover most of your requirements without further effort.

---

<div class="post-metadata">

### Author: ![ValentaTomas](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/valentatomas/32/2326_2.png) [@ValentaTomas](https://discuss.prosemirror.net/u/ValentaTomas)
#### Post date: [September 9, 2021, 4:32pm UTC](https://discuss.prosemirror.net/t/how-to-create-an-undeletable-header-node-that-has-editable-content/4046/3 "2021-09-09T16:32:54Z")

</div>

I’m not 100% sure how to use the schema constraints - something along these lines?

```auto
const schema = new Schema({
  nodes: {
    doc: {content: "fixedHeaderGroup block+"},
    headerField: {group: "headerContent", content: "text*"},
    fixedHeader: {group: "fixedHeaderGroup" content: "headerContent*"},
    text: {},
  },
})

```
