Add an add entry button to my Plugin in Craft CP Hey I'm writing my first Craft plugin and would like to add a button to have a dialog box in . I want to create a link to a page entry with this and save it to the database.

This is the code I want to extend in my template: 

{% import "_includes/forms" as forms %}

    &lt;div class="" style="width: 50%"&gt;
        &lt;form method="post" action="" accept-charset="UTF-8"&gt;
            &lt;input type="hidden" name="action" value="glossary/entry/saveEntry"&gt;
            &lt;input type="hidden" name="redirect" value="glossary"&gt;
            {{ forms.textField({
               label: 'Glossary Entry'|t,
               instructions: 'Enter a new Word'|t,
               id: 'entry',
               name: 'entry',
               value: ''}) }}
            &lt;input class="btn submit" type="submit" value="{{ 'Submit'|t }}"&gt;
        &lt;/form&gt;
    &lt;/div&gt;
I believe what you need is the elementSelect field type which Craft bundles with the CMS. You can find the template of this field in craft/app/templates/_includes/elementSelect.html

Here's a quick example that will get you started:

{{ forms.elementSelectField({
    label: 'Select An Entry'|t,
    instructions: 'Select...'|t,
    id: 'entry',
    name: 'entry',
    elementType: craft.elements.getElementType("Entry"),
    source: '',
    criteria: '',
    sourceElementId: '',
    elements: '',
    storageKey: '',
    viewMode: 'list',
    limit: 1
 }) }}