Answers.Body: <p>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 <code>craft/app/templates/_includes/elementSelect.html</code></p>
  
  <p>Here's a quick example that will get you started:</p>
  
  <pre><code>{{ 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
   }) }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-07T13:55:09.477Z
Answers.Text: Thanks i'll check that!  Where is the doc for this stuff?
Answers.UserDisplayName: Simon Müller
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-07T14:05:27.287Z
Answers.Text: @SimonMüller No problem. As far as I know there isn't any, it's just from my experience of reverse engineering these fields previously.
Answers.UserDisplayName: Stephen Hamilton
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-07T11:59:35.663Z
Answers.LastActivityDate: 2016-10-07T13:09:51.483Z
Answers.LastEditDate: 2016-10-07T13:09:51.483Z
Answers.UserDisplayName: Stephen Hamilton
Body: <p>Hey I'm writing my first Craft plugin and would like to add a button to have a dialog box in <a href="https://i.sstatic.net/tAA1a.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tAA1a.png" alt="Choose an entry"></a>. I want to create a link to a page entry with this and save it to the database.</p>
  
  <p>This is the code I want to extend in my template: </p>
  
  <pre><code>{% 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;
  </code></pre>
  
Tags: <plugins><control-panel><cp-dashboard>
Title: Add an add entry button to my Plugin in Craft CP
ThreadText: # Add an add entry button to my Plugin in Craft CP
  
  (Asked by: username_0 on 2016-10-07)
  
  Hey I'm writing my first Craft plugin and would like to add a button to have a dialog box in [![Choose an entry](https://i.sstatic.net/tAA1a.png)](https://i.sstatic.net/tAA1a.png). 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 %}
  
      <div class="" style="width: 50%">
          <form method="post" action="" accept-charset="UTF-8">
              <input type="hidden" name="action" value="glossary/entry/saveEntry">
              <input type="hidden" name="redirect" value="glossary">
              {{ forms.textField({
                 label: 'Glossary Entry'|t,
                 instructions: 'Enter a new Word'|t,
                 id: 'entry',
                 name: 'entry',
                 value: ''}) }}
              <input class="btn submit" type="submit" value="{{ 'Submit'|t }}">
          </form>
      </div>
  
  ```
  
  **Tags:** plugins, control-panel, cp-dashboard
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-10-07. Score: 3 | Accepted answer
  
  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
   }) }}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks i'll check that!  Where is the doc for this stuff?  
  > **username_1**: @username_0 No problem. As far as I know there isn't any, it's just from my experience of reverse engineering these fields previously.  
  
  ---
  
  