1

So I just installed the GuestEntries Plugin. Whenever I submit the form, I get

"POST param “sectionId” doesn’t exist"

      <form method="post" action="" accept-charset="UTF-8">
        {{ getCsrfInput() }}
        <input type="hidden" name="action" value="guestEntries/saveEntry">
        <input type="hidden" name="redirect" value="success">
        <input type="hidden" name="opiniones" value="3">
        <label for="title">Title</label>
        <input id="title" type="text" name="title">
        <label for="body">Body</label>
        <textarea id="body" name="fields[body]"></textarea>
        <input type="submit" value="Publish">
</form>

-opiniones is the section id.

-Have the section allowed for guest posts, with a user selected.

-Only other plugin Im using is the contact form 1.81

-running Craft CMS 2.6.2964 Personal

Any one can give me hand.?

Thanks

1 Answer 1

2

The plugin is expecting the POST parameter to be sectionId rather than opiniones. Changing the name attribute on that hidden input to sectionId should fix your issue.

The other requirements when creating entries from front-end template using Guest Entries are outlined below.

Make sure Allow guest submissions? is checked in the plugin’s settings (example.com/admin/settings/plugins/guestentries) and set a default author for the section entries will be saved to.

<input type="hidden" name="sectionId" value="3">

The value for sectionId can be determined by going to section settings in the control panel (example.com/admin/settings/sections) and clicking the name of the section you want to use Guest Entries with. The section’s ID is the last segment of the URL (e.g example.com/admin/settings/sections/3)

<input type="hidden" name="redirect" value="success">

The value for redirect is where a visitor will be redirected upon a successful submission and should be a valid path or URL.

A form field should be added for each field you want to save content to. Be sure to include any fields marked required on the entry type’s settings page (example.com/admin/settings/sections/3/entrytypes/3).

<input type="text" name="title">

title will always be the value for the name attribute for the entry’s title regardless of what Title Field Label is set to for the entry type in the control panel.

<textarea name="fields[body]"></textarea>

Custom fields will use fields[customFieldHandle] as the value for the name attribute.

9
  • Thank you Stephen. Just realized this as I read your response. Had changed it because of my initial problem, thought it had to be named as the section id... SO... I have the default form from the documentation. doesn't give me the error anymore, but after submit, redirects me to a 404 page, nothing gets posted. I am not logged in by the way. Thanks
    – fidel
    Commented Mar 4, 2017 at 0:54
  • @fidel — On the settings page for the Guest Entries plugin (example.com/admin/settings/plugins/guestentries), make sure Allow guest submissions? is checked and you have a default author assigned to the section you are submitting to. The redirect param ("success") is the path a successful submission is redirected to, so update that to a valid path and it should address the 404. Commented Mar 4, 2017 at 1:13
  • Settings are all good. Is there anything specific on the success page.? Would not having one stop the form from posting.? Thanks again.
    – fidel
    Commented Mar 4, 2017 at 1:30
  • Interesting, I copied your form into a template and installed the plugin and it worked for me after changing the parameter name for sectionId and setting a default author in the plugin settings on the section. Is 3 the ID for the section you are working with (you can find the section ID in the URL for that section in settings)? Do you have any fields marked as required on that section you aren't including in the submission? Commented Mar 4, 2017 at 1:35
  • Cant find where to get the section id... I will have to do a little research and figure that out first. That may be the issue. Also, I didn't have that section with its own url, though that might be it, maybe its a combination of that and wrong id.
    – fidel
    Commented Mar 4, 2017 at 1:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.