# Add a form view content as a notebook page

**URL:** <https://discuss.tryton.org/t/add-a-form-view-content-as-a-notebook-page/3088>\
**Category:** Developer\
**Created:** [July 31, 2020, 8:49pm UTC](https://discuss.tryton.org/t/add-a-form-view-content-as-a-notebook-page/3088 "2020-07-31T20:49:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fransuar](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@fransuar](https://discuss.tryton.org/u/fransuar)\
**Post date:** [July 31, 2020, 8:49pm UTC](https://discuss.tryton.org/t/add-a-form-view-content-as-a-notebook-page/3088/1 "2020-07-31T20:49:31Z")

</div>

Hello!  
I need to know how to put the content of a form into a notebook page on a new form.  
For example. Lets say I have a module “my\_module”, and there is a form view with the next content.

```auto
<form>
   <label name="name"/>
   <field name="name"/>
</form>

```

Now, I have another module, “my\_new\_module”, and there is a form view, that is an expansion of the precedent form. I want to make something like this:

```auto
<data>
    <notebook>
        <page string="Page 1">
            <the content of the original view/>
         </page>
         <page string="Page 2">
          (................)
           </page>
    </notebook>
</data>

```

The idea is to not rewrite (or c/p) everything on the new view.

Thanks.  
Francisco

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [July 31, 2020, 9:08pm UTC](https://discuss.tryton.org/t/add-a-form-view-content-as-a-notebook-page/3088/2 "2020-07-31T21:08:25Z")

</div>

For now, there is no solution to do that except define the notebook in the initial module. Or to replace the entire view.  
But I think we could have a new position option to surround the target with a portion of XML. An initial idea would be:

```auto
<xpath expr="//field[@name="name"]" position="surround">
    <notebook>
         <page string="Page 1">
         </page>
    <notebook>
</xpath>

```

It would put the selected tag in the deepest node.  
But it should also allow to select sibling to surround.

---

<div class="post-metadata">

**Author:** ![fransuar](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@fransuar](https://discuss.tryton.org/u/fransuar)\
**Post date:** [July 31, 2020, 9:23pm UTC](https://discuss.tryton.org/t/add-a-form-view-content-as-a-notebook-page/3088/3 "2020-07-31T21:23:45Z")

</div>

That would be great!  
I tried to “hack-it” with postition=“before” and position=“after”, adding the corresponding elements. Of course, with no success.

And what about to “call” those elements, like saying “from this node - to this node” put it here or something else.  
Something like  
\<xpath origin=“view\_id” start\_expr=“//starting\_node” end\_expr=“//ending\_node” attribute=“some\_options”/\>  
some\_options=[‘paste’,‘move’,‘delete’,‘some\_other\_options’]

Sorry, I am not a computer scientist, so I don’t know if it is even right the idea I am proposing.

Thanks for the answer and the editing. I cannot find the upper … on my keyboard.  
All the best.  
Francisco
