# Container XML Code

**URL:** <https://speciforum.org/t/container-xml-code/2242>\
**Category:** Get Help\
**Created:** [January 7, 2025, 9:11pm UTC](https://speciforum.org/t/container-xml-code/2242 "2025-01-07T21:11:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fergashl](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@fergashl](https://speciforum.org/u/fergashl)\
**Post date:** [January 7, 2025, 9:11pm UTC](https://speciforum.org/t/container-xml-code/2242/1 "2025-01-07T21:11:36Z")

</div>

Hello, where can I find the XML code to add containers to my collection object form?

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [January 8, 2025, 8:55pm UTC](https://speciforum.org/t/container-xml-code/2242/2 "2025-01-08T20:55:55Z")

</div>

Hi @fergashl,

> ⚠ We will soon launch the **Collection Object Group** table with the initial release of the Geology discipline in the first quarter of this year. This new table will replace the current one as the recommended mechanism to group together collection objects!
> 
> Please note that the data in this table will never be automatically deleted. It will remain accessible for the foreseeable future, but we can discuss migrating the data together at some point!

Containers are only fully supported in Specify 6, but you can use the following XML code you to add to your Collection Object form is as follows:

## In Specify 6

### XML Lines to add to Collection Object View Definition

```xml
<row>
    <cell type="panel" id="ContainerPanel" name="ContainerPanel" coldef="p" rowdef="p" colspan="11">
        <rows>
            <row>
                <cell type="panel" id="CPInner" name="CPInner" coldef="p" rowdef="p">
                <rows>
                    <row>
                        <cell type="field" id="ContainerPlugin" uitype="plugin" name="this" initialize="name=ContainerPlugin"/>
                    </row>
                </rows>
            </cell>
            </row>
        </rows> 
    </cell>
</row>

```

## In Specify 7

It is not **fully supported** , and is deprecated in favor of the future **Collection Object Groups** system, scheduled for launch in Q1 2025.

### XML Lines to add to Collection Object View Definition

```xml
<cell type="label" labelfor="container"/>
<cell type="field" id="container" name="container" uitype="querycbx" isrequired="false" colspan="3"/>
<cell type="label" labelfor="containerOwner"/>
<cell type="field" id="containerOwner" name="containerOwner" uitype="querycbx" isrequired="false" colspan="3"/>

```

### XML View Definition for Container

```xml
<viewdef name="Container" class="edu.ku.brc.specify.datamodel.Container" type="form" gettable="edu.ku.brc.af.ui.forms.DataGetterForObj" settable="edu.ku.brc.af.ui.forms.DataSetterForObj" useresourcelabels="true">
	<desc>Container Description</desc>
	<enableRules/>
	<columnDef>100px,2px,178px,5px,108px,2px,130px,5px,100px,2px,195px,0px,15px,p:g</columnDef>
	<columnDef os="lnx">115px,2px,196px,2px,113px,2px,150px,2px,115px,5px,215px,0px,15px,p:g</columnDef>
	<columnDef os="mac">130px,2px,216px,2px,133px,2px,170px,2px,135px,5px,235px,0px,15px,p:g</columnDef>
	<columnDef os="exp">p,2px,p:g,2px,p:g(2),5px,p:g,2px,p:g(2),5px:g,p,2px,p:g,0px,p,p:g</columnDef>
	<rowDef auto="true" cell="p" sep="2px"/>
	<rows>
		<row>
			<cell type="label" labelfor="nm"/>
			<cell type="field" id="nm" name="name" uitype="text" colspan="3"/>
			<cell type="label" labelfor="parent"/>
			<cell type="field" id="parent" name="parent" uitype="querycbx" initialize="name=Container;displaydlg=ContainerDisplay;searchdlg=ContainerSearch" colspan="3"/>
		</row>
		<row>
			<cell type="label" labelfor="remarks"/>
			<cell type="field" id="remarks" name="description" uitype="textareabrief" colspan="10"/>
		</row>
		<row>
			<cell type="subview" id="collectionObject" name="collectionObjects" viewname="AccessionItems" initialize="addsearch=true;title=COLOBJ_IN_CONTR" defaulttype="table" colspan="13"/>
		</row>
		<row>
			<cell type="subview" id="children" name="children" viewname="ContainerBriefTable" initialize="addsearch=true;title=SUBCONTAINERS" defaulttype="table" colspan="13"/>
		</row>
	</rows>
</viewdef>

```

You can use this XML to display data captured in the Container table in Specify 7, and to a limited extent, add and remove data from it.

---

<div class="post-metadata">

**Author:** ![fergashl](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@fergashl](https://speciforum.org/u/fergashl)\
**Post date:** [January 8, 2025, 9:37pm UTC](https://speciforum.org/t/container-xml-code/2242/3 "2025-01-08T21:37:26Z")

</div>

Ah, for some reason I thought the containers were available already! I will wait until it is ready to go then!

Thanks,  
Ashley

---

<div class="post-metadata">

**Author:** ![fergashl](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@fergashl](https://speciforum.org/u/fergashl)\
**Post date:** [April 7, 2025, 6:22pm UTC](https://speciforum.org/t/container-xml-code/2242/4 "2025-04-07T18:22:36Z")

</div>

Hi Grant,

I was wondering if the Collection Object Group tables were now available. I thought that I saw in one of the updates that it was now but it might have to be requested.

Thanks,  
Ashley

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [April 7, 2025, 6:32pm UTC](https://speciforum.org/t/container-xml-code/2242/5 "2025-04-07T18:32:05Z")

</div>

Hi @fergashl,

This will be available to all Specify Cloud hosted users upon the release of Specify 7.10.2, launching sometime in the next few weeks. Once it is available, I can reach out and help set this up on your instance!

---

<div class="post-metadata">

**Author:** ![fergashl](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@fergashl](https://speciforum.org/u/fergashl)\
**Post date:** [April 7, 2025, 6:47pm UTC](https://speciforum.org/t/container-xml-code/2242/6 "2025-04-07T18:47:42Z")

</div>

Awesome, thank you!
