Sorry, I didn’t express myself clearly, that’s because my head is spinning after 2 days fiddling with this form… I’ll try again. 😊
- for textareas and textinput I use the method from this wiki entry. This works fine for input and preview, but whatever I try, all the fields default to formatting=xhtml , which is not good for displaying the data later. Fields are set to formatting: none in the backend, plus I tried to add the line
<input type="hidden" id="field_ft_36" value="none" />
with the corresponding field-value for every field, but that doesn’t change anything either.
- for the dropdowns, I now use your plugin (thanks again!), which works great for populating the dropdowns and also retains the formatting. But it doesn’t carry the selections over to the preview.
- The standard “custom fields”-Tag ist used for the relationships, which works fine so far.
There’s 40 custom fields in the form, so I’m not gonna post all that repetitive stuff, but an extract with one for each method: (template is called add_entry)
// this is the php for retaining the value of a field in preview, as posted in the wiki
<?
if (isset($_POST['field_id_15'])) {
$field_id_14 = $_POST['field_id_15'];
}
else {
$field_id_15 = '';
}
?>
// the form tag. show_fields is used for a standard display of related entries:
{exp:weblog:entry_form weblog="weblog" return="weblog/index" preview="weblog/add_entry" show_fields="image_1|image_2|image_3"}
// a text field:
Hours:
<input type="text" dir="ltr" id="field_id_15" name="field_id_15" value="<?php echo $field_id_15;?>" maxlength="128" size="12" onclick="setFieldName(this.name)" /><input type="hidden" id="field_ft_15" value="none" />
// a dropdown:
Year:
{exp:pops:pop_input value="{year}" field="year"}
{popup}
<input type="hidden" name="{field_format}" value="none" />
{/exp:pops:pop_input}
// at the end of the form, there is this codebit for the relationships:
{custom_fields}{if relationship}
<select name="{field_name}">
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
</select>
{/if}
{/custom_fields}
// and finally, preview/submit and closing the form tag
<input type="submit" name="submit" value="Save" /> <input type="submit" name="preview" value="Preview" />
{/exp:weblog:entry_form}
My understanding is that the php-part on top is needed for the preview to work, but I am unsure how to integrate that with the plugin?