1

When I submit an entry through my Channel Form, the regular old URL Title is being populated correctly, but there is no entry for Structure URL Title. Aren't these two things supposed to synchronize automatically when a new entry is created? How do I fix it?

Everything works fine when I add an entry from the control panel. The problem occurs when the Channel Form is used.

I'm using:

  • EE 2.9.2
  • Structure v3.3.18

Update to add channel form code:

{layout="layouts/.my-layout" title="" section="{segment_1}"}

{!-- Insert form here --}
{exp:channel:form 
channel="mychannel"
return="/{freebie_1}/{freebie_2}/{freebie_3}/{freebie_4}/thank-you"
logged_out_member_id="2"
error_validation="inline"
secure_action="yes"
}

<label for="post_first_name" class="required">First Name
    <input type="text" name="post_first_name" id="post_first_name" required />
</label>
{if error:post_first_name}<small class="error">{error:post_first_name}</small>{/if}

<label for="post_last_name" class="required">Last Name
    <input type="text" name="post_last_name" id="post_last_name" required />
</label>
{if error:post_last_name}<small class="error">{error:post_last_name}</small>{/if}

<label for="post_email" class="required">Email Address
    <input type="email" name="post_email" id="post_email" required />
</label>
{if error:post_email}<small class="error">{error:post_email}</small>{/if}

<label for="title" class="required">Post Title
    <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();" required />
</label>
{if error:title}<small class="error">{error:title}</small>{/if}

<label for="categories" class="required">Category</label>
<select name="category[]" id="categories">
  <option value="">**Select**</option>
  {categories}
    <option value="{category_id}"{selected}>{category_name}</option>
  {/categories}
</select>

<label for="post_body" class="required">{label:post_body}
    {field:post_body}
</label>
{if error:post_body}<small class="error">{error:post_body}</small>{/if}

<input type="submit" value="Submit" class="button small radius" />

{/exp:channel:form}

1 Answer 1

0

You'll want to add the following hidden input fields to your form.

<input type="hidden" name="structure_template_id" value="XXXX" />
<input type="hidden" name="structure_parent_id" value="XXXX" />
<input type="text" name="structure_uri" /> <!-- required -->

See documentation.

1
  • I've tried this with no luck, it still does not introduce a structure url. Would there be a reason why? Nov 3, 2017 at 9:46

Your Answer

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

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