I am currently building a web app that allows users to create a list of their own contacts which are then stored as channel entries. This generally works fine however the Structure URLs are not being generated as expected.
I have created the form as below. The dynamic title is working and is being set on a simple jquery keyup handler. When I submit the form using ajax, the entry is created along with all the relevant data but rather than the entry being accessed at domain.com/channel/john-doe it is found directly at domain.com/john-doe.
I have gone as far as to use the Structure module's suggested additional tags:
<input type="hidden" name="structure_template_id" value="21" />
<input type="hidden" name="structure_parent_id" value="{structure:parent:entry_id}" />
but there was no joy and I simply experienced the exact same result. Any suggestions? Full code below (not including the additional structure fields).
{exp:safecracker channel="contacts" dynamic_title="[contact_name]" safecracker_head="no" include_jquery="no" return="safecracker/ENTRY_ID" json="yes" id="addContact"}
<input type="hidden" name="contact_list_designation" value="A" id="contact_list_designation"/>
<input type="hidden" name="contact_name">
<div class="content-bar bar light shiny top">
<div class="section">
<div class="center">
<div>
<div class="title">New Contact</div>
</div>
</div>
</div>
</div>
<div class="grid-container fieldset-holder">
<fieldset class="inline">
<label class="grid-25">Type</label>
<div class="grid-75">
<div data-toggle="buttons-radio" class="buttonset cf block designation_radios">
<div class="button grid-33 active-primary active"><span>A</span></div>
<div class="button grid-33 active-primary"><span>B</span></div>
<div class="button grid-33 active-primary"><span>C</span></div>
</div>
</div>
</fieldset>
<fieldset class="grid-50">
<label>Firstname</label>
<input type="text" name="contact_firstname">
</fieldset>
<fieldset class="grid-50">
<label>Lastname</label>
<input type="text" name="contact_lastname">
</fieldset>
<fieldset>
<label>Company</label>
<input type="text" name="contact_company">
</fieldset>
<fieldset>
<label>Email</label>
<input type="text" placeholder="[email protected]" name="contact_email">
</fieldset>
</div>
{/exp:safecracker}