Answers.Body: <p>There's two methods for this, the first one I'll assume your frontend form doesnt directly make a new entry, but does other things and triggers a new entry <em>as well</em>. The second, I will assume your form is directly making an entry as soon as you hit submit, and is getting all of your entry info from the form itself.</p>
  <p><strong>METHOD 1 - THE FORM IS NOT THE ENTRY INFO</strong></p>
  <p>To do this via PHP you will need to create a Module. Modules are a Yii convention for extending PHP functionality.</p>
  <p>Start Here in the &quot;Extending Craft&quot; docs: <a href="https://craftcms.com/docs/4.x/extend/module-guide.html" rel="nofollow noreferrer">https://craftcms.com/docs/4.x/extend/module-guide.html</a></p>
  <p>Then, you will want to create a public controller for the module, which you can call as the form's action in your code.</p>
  <p>Controllers Guide:
  <a href="https://craftcms.com/docs/4.x/extend/controllers.html#creating-a-controller" rel="nofollow noreferrer">https://craftcms.com/docs/4.x/extend/controllers.html#creating-a-controller</a></p>
  <p>Since you are looking to make new entries, the entries guide is your next stop: <a href="https://craftcms.com/docs/4.x/entries.html" rel="nofollow noreferrer">https://craftcms.com/docs/4.x/entries.html</a></p>
  <p><strong>METHOD 2 - THE FORM IS THE ENTRY INFO</strong></p>
  <pre><code>&lt;form method=&quot;post&quot; accept-charset=&quot;UTF-8&quot; enctype=&quot;multipart/form-data&quot; class=&quot;send-form&quot; id=&quot;send-form&quot;&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;entries/saveEntry&quot;/&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;sectionId&quot; value=&quot;X&quot;&gt; // Required! ID# of the section
      &lt;input type=&quot;hidden&quot; name=&quot;typeId&quot; value=&quot;X&quot;&gt; // ID# of the entry type
      &lt;input type=&quot;hidden&quot; name=&quot;enabled&quot; value=&quot;1&quot;&gt;
      
      &lt;label&gt;Text Field
          &lt;input type=&quot;text&quot; name=&quot;fields[customField]&quot; value=&quot;&quot;&gt;
      &lt;/label&gt;
  
      [... some more fields ...]
  
       &lt;input class=&quot;btn-vote&quot; type=&quot;submit&quot; value=&quot;send&quot;&gt;
  
  &lt;/form&gt;
  </code></pre>
  <p>Here's some guides and help for frontend forms:</p>
  <p>Matrix (New &amp; Editing Existing): <a href="https://craftcms.stackexchange.com/questions/36017/adding-a-block-of-matrix-field-from-a-front-end-entry-form">adding a block of matrix field from a front end entry form</a></p>
  <p>Video Tutorial (CraftQuest):
  <a href="https://craftquest.io/lessons/publishing-entries-from-the-front-end" rel="nofollow noreferrer">https://craftquest.io/lessons/publishing-entries-from-the-front-end</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-02T04:21:19.963Z
Answers.LastActivityDate: 2023-03-02T04:21:19.963Z
Answers.UserDisplayName: cherrykoda
Answers.Body: <p>If you mean the same things that Craft refers to as <em>elements</em> and <em>sections</em>, you can create a new entry in a section by opening the CMS and navigating to <em>Entries</em> using the sidebar menu. Select the desired section, then click the <em>New entry</em> button on the upper right. This creates a new unpublished draft, which you can then edit and publish when you're done.</p>
  <p>If you mean something else, please explain what you're trying to do in detail.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-05T07:41:03.203Z
Answers.LastActivityDate: 2022-09-05T07:41:03.203Z
Answers.UserDisplayName: MoritzLost
Body: <p>I use Craft CMS 4.2.3. I can't find information on how to add an element from the site to a certain section. Please help me solve the problem. It would be very cool if it were some simple example. Thank you in advance.</p>
  <p>I mean to add an element to the section not through the administrative panel. And, for example, create a form on the site and through it add an element to the section.</p>
  
Tags: <craft3>
Title: How do I add an element to a section from the site?
ThreadText: # How do I add an element to a section from the site?
  
  (Asked by: username_0 on 2022-09-04)
  
  I use Craft CMS 4.2.3. I can't find information on how to add an element from the site to a certain section. Please help me solve the problem. It would be very cool if it were some simple example. Thank you in advance.
  
  I mean to add an element to the section not through the administrative panel. And, for example, create a form on the site and through it add an element to the section.
  
  **Tags:** craft3
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-03-02. Score: 4
  
  There's two methods for this, the first one I'll assume your frontend form doesnt directly make a new entry, but does other things and triggers a new entry *as well*. The second, I will assume your form is directly making an entry as soon as you hit submit, and is getting all of your entry info from the form itself.
  
  **METHOD 1 - THE FORM IS NOT THE ENTRY INFO**
  
  To do this via PHP you will need to create a Module. Modules are a Yii convention for extending PHP functionality.
  
  Start Here in the "Extending Craft" docs: <https://craftcms.com/docs/4.x/extend/module-guide.html>
  
  Then, you will want to create a public controller for the module, which you can call as the form's action in your code.
  
  Controllers Guide:
  <https://craftcms.com/docs/4.x/extend/controllers.html#creating-a-controller>
  
  Since you are looking to make new entries, the entries guide is your next stop: <https://craftcms.com/docs/4.x/entries.html>
  
  **METHOD 2 - THE FORM IS THE ENTRY INFO**
  
  ```
  <form method="post" accept-charset="UTF-8" enctype="multipart/form-data" class="send-form" id="send-form">
      <input type="hidden" name="action" value="entries/saveEntry"/>
      <input type="hidden" name="sectionId" value="X"> // Required! ID# of the section
      <input type="hidden" name="typeId" value="X"> // ID# of the entry type
      <input type="hidden" name="enabled" value="1">
      
      <label>Text Field
          <input type="text" name="fields[customField]" value="">
      </label>
  
      [... some more fields ...]
  
       <input class="btn-vote" type="submit" value="send">
  
  </form>
  
  ```
  
  Here's some guides and help for frontend forms:
  
  Matrix (New & Editing Existing): [adding a block of matrix field from a front end entry form](https://craftcms.stackexchange.com/questions/36017/adding-a-block-of-matrix-field-from-a-front-end-entry-form)
  
  Video Tutorial (CraftQuest):
  <https://craftquest.io/lessons/publishing-entries-from-the-front-end>
  
  
  ---
  
  ### Answer by username_2 on 2022-09-05. Score: 2
  
  If you mean the same things that Craft refers to as *elements* and *sections*, you can create a new entry in a section by opening the CMS and navigating to *Entries* using the sidebar menu. Select the desired section, then click the *New entry* button on the upper right. This creates a new unpublished draft, which you can then edit and publish when you're done.
  
  If you mean something else, please explain what you're trying to do in detail.
  
  
  ---
  
  