diff --git a/core/lib/Thelia/Form/Brand/BrandCreationForm.php b/core/lib/Thelia/Form/Brand/BrandCreationForm.php index 65e0efb7b..88977dc5c 100644 --- a/core/lib/Thelia/Form/Brand/BrandCreationForm.php +++ b/core/lib/Thelia/Form/Brand/BrandCreationForm.php @@ -38,12 +38,13 @@ class BrandCreationForm extends BaseForm 'label' => Translator::getInstance()->trans('Brand name'), 'label_attr' => [ 'for' => 'title', - 'placeholder' => Translator::getInstance()->trans('The brand name or title'), 'help' => Translator::getInstance()->trans( 'Enter here the brand name in the default language (%title%)', [ '%title%' => Lang::getDefaultLanguage()->getTitle()] ), - 'i18n' => 'default' + ], + 'attr' => [ + 'placeholder' => Translator::getInstance()->trans('The brand name or title'), ] ] ) diff --git a/core/lib/Thelia/Form/Brand/BrandModificationForm.php b/core/lib/Thelia/Form/Brand/BrandModificationForm.php index d30b8ad0d..9d96a5b4b 100644 --- a/core/lib/Thelia/Form/Brand/BrandModificationForm.php +++ b/core/lib/Thelia/Form/Brand/BrandModificationForm.php @@ -48,8 +48,10 @@ class BrandModificationForm extends BrandCreationForm 'required' => true, 'label' => Translator::getInstance()->trans('Brand name'), 'label_attr' => [ - 'for' => 'title', - 'placeholder' => Translator::getInstance()->trans('The brand name or title'), + 'for' => 'title' + ], + 'attr' => [ + 'placeholder' => Translator::getInstance()->trans('The brand name or title') ] ] ) diff --git a/core/lib/Thelia/Form/Image/DocumentModification.php b/core/lib/Thelia/Form/Image/DocumentModification.php index 80278d4b1..62b5750e0 100644 --- a/core/lib/Thelia/Form/Image/DocumentModification.php +++ b/core/lib/Thelia/Form/Image/DocumentModification.php @@ -15,6 +15,7 @@ namespace Thelia\Form\Image; use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Core\Translation\Translator; use Thelia\Form\BaseForm; +use Thelia\Form\StandardDescriptionFieldsTrait; /** * Created by JetBrains PhpStorm. @@ -22,7 +23,6 @@ use Thelia\Form\BaseForm; * Time: 3:56 PM * * Form allowing to process a file - * @todo refactor make all document using propel inheritance and factorise image behaviour into one single clean action * * @package File * @author Guillaume MOREL @@ -30,6 +30,8 @@ use Thelia\Form\BaseForm; */ abstract class DocumentModification extends BaseForm { + use StandardDescriptionFieldsTrait; + /** * @inheritdoc */ @@ -38,81 +40,18 @@ abstract class DocumentModification extends BaseForm $this->formBuilder->add( 'file', 'file', - array( + [ 'required' => false, - 'constraints' => array(), + 'constraints' => [ ], 'label' => Translator::getInstance()->trans('Replace current document by this file'), - 'label_attr' => array( + 'label_attr' => [ 'for' => 'file' - ) - ) - ) - ->add( - 'title', - 'text', - array( - 'required' => true, - 'constraints' => array( - new NotBlank() - ), - 'label' => Translator::getInstance()->trans('Title'), - 'label_attr' => array( - 'for' => 'title' - ) - ) - ) - ->add( - 'description', - 'textarea', - array( - 'required' => false, - 'constraints' => array(), - 'label' => Translator::getInstance()->trans('Description'), - 'label_attr' => array( - 'for' => 'description', - 'rows' => 5 - ) - ) - ) - ->add( - 'chapo', - 'textarea', - array( - 'required' => false, - 'constraints' => array(), - 'label' => Translator::getInstance()->trans('Chapo'), - 'label_attr' => array( - 'for' => 'chapo', - 'rows' => 3 - ) - ) - ) - ->add( - 'postscriptum', - 'textarea', - array( - 'required' => false, - 'constraints' => array(), - 'label' => Translator::getInstance()->trans('Post Scriptum'), - 'label_attr' => array( - 'for' => 'postscriptum', - 'rows' => 3 - ) - ) - ) - ->add( - "locale", - "hidden", - array( - 'required' => true, - "constraints" => array( - new NotBlank() - ), - "label_attr" => array( - "for" => "locale_create" - ) - ) - ) - ; + ] + ] + ); + + // Add standard description fields + $this->addStandardDescFields(); + } } diff --git a/core/lib/Thelia/Form/Image/ImageModification.php b/core/lib/Thelia/Form/Image/ImageModification.php index 0af0eaeb2..d53fe84f6 100644 --- a/core/lib/Thelia/Form/Image/ImageModification.php +++ b/core/lib/Thelia/Form/Image/ImageModification.php @@ -16,6 +16,7 @@ use Symfony\Component\Validator\Constraints\Image; use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Core\Translation\Translator; use Thelia\Form\BaseForm; +use Thelia\Form\StandardDescriptionFieldsTrait; /** * Created by JetBrains PhpStorm. @@ -23,14 +24,14 @@ use Thelia\Form\BaseForm; * Time: 3:56 PM * * Form allowing to process an image - * @todo refactor make all pictures using propel inheritance and factorise image behaviour into one single clean action - * + * * @package Image * @author Guillaume MOREL * */ abstract class ImageModification extends BaseForm { + use StandardDescriptionFieldsTrait; /** * @inheritdoc @@ -40,88 +41,24 @@ abstract class ImageModification extends BaseForm $this->formBuilder->add( 'file', 'file', - array( + [ 'required' => false, - 'constraints' => array( + 'constraints' => [ new Image( - array( + [ // 'minWidth' => 200, // 'minHeight' => 200 - ) + ] ) - ), + ], 'label' => Translator::getInstance()->trans('Replace current image by this file'), - 'label_attr' => array( + 'label_attr' => [ 'for' => 'file' - ) - ) - ) - ->add( - 'title', - 'text', - array( - 'required' => true, - 'constraints' => array( - new NotBlank() - ), - 'label' => Translator::getInstance()->trans('Title'), - 'label_attr' => array( - 'for' => 'title' - ) - ) - ) - ->add( - 'description', - 'textarea', - array( - 'required' => false, - 'constraints' => array(), - 'label' => Translator::getInstance()->trans('Description'), - 'label_attr' => array( - 'for' => 'description', - 'rows' => 5 - ) - ) - ) - ->add( - 'chapo', - 'textarea', - array( - 'required' => false, - 'constraints' => array(), - 'label' => Translator::getInstance()->trans('Chapo'), - 'label_attr' => array( - 'for' => 'chapo', - 'rows' => 3 - ) - ) - ) - ->add( - 'postscriptum', - 'textarea', - array( - 'required' => false, - 'constraints' => array(), - 'label' => Translator::getInstance()->trans('Post Scriptum'), - 'label_attr' => array( - 'for' => 'postscriptum', - 'rows' => 3 - ) - ) - ) - ->add( - "locale", - "hidden", - array( - 'required' => true, - "constraints" => array( - new NotBlank() - ), - "label_attr" => array( - "for" => "locale_create" - ) - ) - ) - ; + ] + ] + ); + + // Add standard description fields + $this->addStandardDescFields(); } } diff --git a/core/lib/Thelia/Form/SeoFieldsTrait.php b/core/lib/Thelia/Form/SeoFieldsTrait.php index 91ee54f0d..6609ee198 100644 --- a/core/lib/Thelia/Form/SeoFieldsTrait.php +++ b/core/lib/Thelia/Form/SeoFieldsTrait.php @@ -29,56 +29,72 @@ trait SeoFieldsTrait protected function addSeoFields($exclude = array()) { if (! in_array('url', $exclude)) - $this->formBuilder - ->add('url', 'text', array( - 'label' => Translator::getInstance()->trans('Rewriten URL'), - 'label_attr' => array( - 'for' => 'rewriten_url_field', + $this->formBuilder->add( + 'url', + 'text', + [ + 'required' => false, + 'label' => Translator::getInstance()->trans('Rewriten URL'), + 'label_attr' => [ + 'for' => 'rewriten_url_field' + ], + 'attr' => [ 'placeholder' => Translator::getInstance()->trans('Use the keyword phrase in your URL.') - ), - 'required' => false - ) + ] + ] ); if (! in_array('meta_title', $exclude)) - $this->formBuilder - ->add('meta_title', 'text', array( - 'label' => Translator::getInstance()->trans('Page Title'), - 'label_attr' => array( + $this->formBuilder->add( + 'meta_title', + 'text', + [ + 'required' => false, + 'label' => Translator::getInstance()->trans('Page Title'), + 'label_attr' => [ 'for' => 'meta_title', - 'placeholder' => Translator::getInstance()->trans('Make sure that your title is clear, and contains many of the keywords within the page itself.'), 'help' => Translator::getInstance()->trans('The HTML TITLE element is the most important element on your web page.') - ), - 'required' => false - ) + ], + 'attr' => [ + 'placeholder' => Translator::getInstance()->trans('Make sure that your title is clear, and contains many of the keywords within the page itself.') + ] + ] ); if (! in_array('meta_description', $exclude)) - $this->formBuilder - ->add('meta_description', 'textarea', array( - 'label' => Translator::getInstance()->trans('Meta Description'), - 'label_attr' => array( + $this->formBuilder->add( + 'meta_description', + 'textarea', + [ + 'required' => false, + 'label' => Translator::getInstance()->trans('Meta Description'), + 'label_attr' => [ 'for' => 'meta_description', - 'rows' => 6, - 'placeholder' => Translator::getInstance()->trans('Make sure it uses keywords found within the page itself.'), 'help' => Translator::getInstance()->trans('Keep the most important part of your description in the first 150-160 characters.') - ), - 'required' => false - ) + ], + 'attr' => [ + 'rows' => 6, + 'placeholder' => Translator::getInstance()->trans('Make sure it uses keywords found within the page itself.') + ] + ] ); if (! in_array('meta_keywords', $exclude)) - $this->formBuilder - ->add('meta_keywords', 'textarea', array( - 'label' => Translator::getInstance()->trans('Meta Keywords'), - 'label_attr' => array( - 'for' => 'meta_keywords', - 'rows' => 3, - 'placeholder' => Translator::getInstance()->trans('Don\'t repeat keywords over and over in a row. Rather, put in keyword phrases.'), - 'help' => Translator::getInstance()->trans('You don\'t need to use commas or other punctuations.') - ), - 'required' => false - ) - ); + $this->formBuilder->add( + 'meta_keywords', + 'textarea', + [ + 'required' => false, + 'label' => Translator::getInstance()->trans('Meta Keywords'), + 'label_attr' => [ + 'for' => 'meta_keywords', + 'help' => Translator::getInstance()->trans('You don\'t need to use commas or other punctuations.') + ], + 'attr' => [ + 'rows' => 3, + 'placeholder' => Translator::getInstance()->trans('Don\'t repeat keywords over and over in a row. Rather, put in keyword phrases.') + ] + ] + ); } -} +} \ No newline at end of file diff --git a/core/lib/Thelia/Form/StandardDescriptionFieldsTrait.php b/core/lib/Thelia/Form/StandardDescriptionFieldsTrait.php index ba3beca2b..04fbbe033 100644 --- a/core/lib/Thelia/Form/StandardDescriptionFieldsTrait.php +++ b/core/lib/Thelia/Form/StandardDescriptionFieldsTrait.php @@ -51,6 +51,9 @@ trait StandardDescriptionFieldsTrait 'label_attr' => [ 'for' => 'title_field', 'placeholder' => Translator::getInstance()->trans('A descriptive title') + ], + 'attr' => [ + ] ] ); @@ -65,11 +68,13 @@ trait StandardDescriptionFieldsTrait 'label' => Translator::getInstance()->trans('Summary'), 'label_attr' => [ 'for' => 'summary_field', - 'rows' => 3, - 'placeholder' => Translator::getInstance()->trans('Short description text'), 'help' => Translator::getInstance()->trans('A short description, used when a summary or an introduction is required') + ], + 'attr' => [ + 'rows' => 3, + 'placeholder' => Translator::getInstance()->trans('Short description text') ] - ] + ] ); if (! in_array('description', $exclude)) @@ -82,8 +87,10 @@ trait StandardDescriptionFieldsTrait 'label' => Translator::getInstance()->trans('Detailed description'), 'label_attr' => [ 'for' => 'detailed_description_field', - 'rows' => 10, 'help' => Translator::getInstance()->trans('The detailed description.') + ], + 'attr' => [ + 'rows' => 10 ] ] ); @@ -98,9 +105,11 @@ trait StandardDescriptionFieldsTrait 'label' => Translator::getInstance()->trans('Conclusion'), 'label_attr' => [ 'for' => 'conclusion_field', - 'rows' => 3, - 'placeholder' => Translator::getInstance()->trans('Short additional text'), 'help' => Translator::getInstance()->trans('A short text, used when an additional or supplemental information is required.') + ], + 'attr' => [ + 'placeholder' => Translator::getInstance()->trans('Short additional text'), + 'rows' => 3, ] ] ); diff --git a/templates/backOffice/default/brand-edit.html b/templates/backOffice/default/brand-edit.html index 487ebd722..6be1c0bfd 100644 --- a/templates/backOffice/default/brand-edit.html +++ b/templates/backOffice/default/brand-edit.html @@ -69,8 +69,8 @@ {form_hidden_fields form=$form} - {admin_form_field form=$form name="success_url" value={url path="/admin/brand"}} - {admin_form_field form=$form name="locale" value={$edit_language_locale}} + {render_form_field form=$form field="success_url" value={url path="/admin/brand"}} + {render_form_field form=$form field="locale" value={$edit_language_locale}} {if $form_error}
{$form_error_message}
@@ -82,27 +82,17 @@
- {admin_form_field form=$form name="visible"} + {render_form_field form=$form field="visible"} - {form_field form=$form field='logo_image_id'} -
- - {admin_form_field_label form=$form name='logo_image_id'} - - - - {if $label_attr.help} - {$label_attr.help} - {/if} -
- {/form_field} + {custom_render_form_field form=$form field='logo_image_id'} + + {/custom_render_form_field}
diff --git a/templates/backOffice/default/brands.html b/templates/backOffice/default/brands.html index 361033606..c30a03690 100644 --- a/templates/backOffice/default/brands.html +++ b/templates/backOffice/default/brands.html @@ -190,12 +190,26 @@ {* Switch edition to the current locale *} - {admin_form_field form=$form name="locale" value=$LOCALE} + {render_form_field form=$form field="locale" value=$LOCALE} {/loop} - {admin_form_field form=$form name="success_url" value={url path='/admin/brand/update/_ID_'}} - {admin_form_field form=$form name="title"} - {admin_form_field form=$form name="visible"} + {render_form_field form=$form field="success_url" value={url path='/admin/brand/update/_ID_'}} + + {custom_render_form_field form=$form field="title"} + {loop type="lang" name="default-lang" default_only="1"} + {* Switch edition to the current locale *} + + + {render_form_field field="locale" value=$LOCALE} + +
+ + {$TITLE} +
+ {/loop} + {/custom_render_form_field} + + {render_form_field form=$form field="visible"} {module_include location='brand_create_form'} diff --git a/templates/backOffice/default/document-edit.html b/templates/backOffice/default/document-edit.html index c95c2daf2..09e06a6b8 100644 --- a/templates/backOffice/default/document-edit.html +++ b/templates/backOffice/default/document-edit.html @@ -40,8 +40,8 @@ {form_hidden_fields form=$form} - {admin_form_field form=$form name="success_url" value="{url path="/admin/document/type/{$documentType}/{$ID}/update"}"} - {admin_form_field form=$form name="locale" value="$edit_language_locale"} + {render_form_field form=$form field="success_url" value="{url path="/admin/document/type/{$documentType}/{$ID}/update"}"} + {render_form_field form=$form field="locale" value="$edit_language_locale"} {if $form_error}
{$form_error_message}
{/if} @@ -57,15 +57,15 @@
- {admin_form_field form=$form name="file"} - {admin_form_field form=$form name="title" value=$TITLE} - {admin_form_field form=$form name="chapo" value=$CHAPO} - {admin_form_field form=$form name="postscriptum" value=$POSTSCRIPTUM} + {render_form_field form=$form field="file"} + {render_form_field form=$form field="title" value=$TITLE} + {render_form_field form=$form field="chapo" value=$CHAPO} + {render_form_field form=$form field="postscriptum" value=$POSTSCRIPTUM}
- {admin_form_field form=$form name="description" value=$DESCRIPTION extra_class="wysiwyg"} + {render_form_field form=$form field="description" value=$DESCRIPTION extra_class="wysiwyg"}
diff --git a/templates/backOffice/default/forms/form-field-attributes-standard-renderer.html b/templates/backOffice/default/forms/form-field-attributes-standard-renderer.html new file mode 100644 index 000000000..e1558d982 --- /dev/null +++ b/templates/backOffice/default/forms/form-field-attributes-standard-renderer.html @@ -0,0 +1,21 @@ +{* +This file defines the standard fields attributes, depending on input types. + +In addition to the standard form_field block output, this fragment uses the following additional variables : + +- field_template : the template style ('standard', or somethingelse) +- field_value : the value of the input field, which is used if the form_field value is empty. +- field_extra_class : an extra class to add to the input class (see form-field-attributes-standard-renderer.html) +*} + +{if $type == 'hidden'} + id="{$label_attr.for}" name="{$name}" value="{$value}" +{elseif $type == 'checkbox' || $type == 'radio'} + class="{$field_extra_class}" type="checkbox" id="{$label_attr.for}" name="{$name}" value="{$value}" {if $checked}checked="checked"{/if} +{elseif $type == 'choice'} + {if $multiple}multiple{/if} {if $lattr_list.size}size="{$lattr_list.size}"{/if} {if $required}aria-required="true" required{/if} id="{$label_attr.for}" name="{$name}"class="form-control class="{$field_extra_class}" +{elseif $type == 'textarea'} + {if $attr_list.rows}rows="{$attr_list.rows}"{/if} {if $required}aria-required="true" required{/if} placeholder="{$attr_list.placeholder|default:$label}" id="{$label_attr.for}" name="{$name}" class="form-control {$field_extra_class}" title="{$label}" +{else} + {if $required}aria-required="true" required{/if} placeholder="{$attr_list.placeholder|default:$label}" id="{$label_attr.for}" name="{$name}" value="{$value}" class="form-control {$field_extra_class}" +{/if} diff --git a/templates/backOffice/default/forms/form-field-standard-renderer.html b/templates/backOffice/default/forms/form-field-standard-renderer.html new file mode 100644 index 000000000..5e338117d --- /dev/null +++ b/templates/backOffice/default/forms/form-field-standard-renderer.html @@ -0,0 +1,126 @@ +{* +This file bind a form field to an HTML representation. In addition to the standard form_field block output, this +fragment uses the following additional variables : + +- field_template : the template style ('standard', or somethingelse) +- field_value : the value of the input field, which is used if the form_field value is empty. +- field_extra_class : an extra class to add to the input class (see form-field-attributes-standard-renderer.html) +- content : if this variable is not empty, we assume that it contains the input field definition. Used by the + custom_render_form_field block to pass a custom representation of the input field. +*} + +{* Use the optionnal $field_value parameter if no value is defined *} +{if empty($value)} + {$value = $field_value} +{/if} + +{* Synthetize an ID if none was given *} +{if empty({$label_attr.for})} + {$label_attr.for = "id-{$field_name}"} +{/if} + +{* Get standard fields attributes *} +{capture assign=attributes} + {include file="forms/form-field-attributes-$field_template-renderer.html"} +{/capture} + +{if $type == 'hidden'} + + + +{elseif $type == 'checkbox'} + +
+ +
+ +{elseif $type == 'radio'} + +
+ +
+ +{else} + +
+ + + + {if $multiple} + {intl l='Use Ctrl+click to select (or deselect) more that one item'} + {/if} + + {if $content == ''} + + {if $type == 'choice'} + + + + {elseif $type == 'textarea'} + + + + {elseif $type == 'money'} + +
+ + {loop name="input.addon" type="currency" default_only="true"}{$SYMBOL}{/loop} +
+ + {else} + + {$text_types = ['text', 'password', 'number', 'money', 'integer', 'time', 'date', 'datetime', 'email', 'url', 'file']} + + {if in_array($type, $text_types)} + {if $type == 'integer' || $type == 'money'}{$type='number'}{/if} + + + {else} +
{intl l="Unsupported field type '%type' in form-field.html" type=$type}
+ {/if} + + {/if} + {else} + {$content nofilter} + {/if} + + {if ! empty($label_attr.help)} + {$label_attr.help} + {/if} +
+{/if} diff --git a/templates/backOffice/default/forms/form-field.html b/templates/backOffice/default/forms/form-field.html deleted file mode 100644 index 48bd40471..000000000 --- a/templates/backOffice/default/forms/form-field.html +++ /dev/null @@ -1,90 +0,0 @@ -{form_field form=$form field=$field_name} - -{* Use the optionnal $field_value parameter if no value is defined *} -{if empty($value)} - {$value = $field_value} -{/if} - -{* Synthetize an ID if none was given *} -{if empty({$label_attr.for})} - {$label_attr.for = "id-{$field_name}"} -{/if} - -{if $type == 'hidden'} - -{elseif $type == 'checkbox'} - -
- -
- -{else} - -
- - {admin_form_field_label form=$form name=$field_name label_attr=$label_attr} - - {if $multiple} - {intl l='Use Ctrl+click to select (or deselect) more that one item'} - {/if} - - {$lang_code = 0} - {if $label_attr.i18n == 'default'} - {loop type="lang" name="default-lang" default_only="1"} - {$lang_code = $CODE} - {$lang_title = $TITLE} -
- {/loop} - {/if} - - {if $type == 'choice'} - - - {elseif $type == 'textarea'} - - - - {elseif $type == 'money'} - -
- - {loop name="input.addon" type="currency" default_only="true"}{$SYMBOL}{/loop} -
- - {else} - - {$text_types = ['text', 'password', 'number', 'money', 'integer', 'time', 'date', 'datetime', 'email', 'url', 'file']} - - {if in_array($type, $text_types)} - {if $type == 'integer' || $type == 'money'}{$type='number'}{/if} - - - - {else} -
{intl l="Unsupported field type '%type' in form-field.html" type=$type}
- {/if} - {/if} - - {if $lang_code} - {$lang_title} -
- {/if} - - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
-{/if} -{/form_field} diff --git a/templates/backOffice/default/forms/form-label.html b/templates/backOffice/default/forms/form-label.html deleted file mode 100644 index ce2af2a58..000000000 --- a/templates/backOffice/default/forms/form-label.html +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/templates/backOffice/default/image-edit.html b/templates/backOffice/default/image-edit.html index 4a97112e2..697b08501 100644 --- a/templates/backOffice/default/image-edit.html +++ b/templates/backOffice/default/image-edit.html @@ -40,8 +40,8 @@ {form_hidden_fields form=$form} - {admin_form_field form=$form name="success_url" value="{url path="/admin/image/type/{$imageType}/{$ID}/update"}"} - {admin_form_field form=$form name="locale" value="$edit_language_locale"} + {render_form_field form=$form field="success_url" value="{url path="/admin/image/type/{$imageType}/{$ID}/update"}"} + {render_form_field form=$form field="locale" value="$edit_language_locale"} {if $form_error}
{$form_error_message}
{/if} @@ -60,15 +60,15 @@
- {admin_form_field form=$form name="file"} - {admin_form_field form=$form name="title" value=$TITLE} - {admin_form_field form=$form name="chapo" value=$CHAPO} - {admin_form_field form=$form name="postscriptum" value=$POSTSCRIPTUM} + {render_form_field form=$form field="file"} + {render_form_field form=$form field="title" value=$TITLE} + {render_form_field form=$form field="chapo" value=$CHAPO} + {render_form_field form=$form field="postscriptum" value=$POSTSCRIPTUM}
- {admin_form_field form=$form name="description" value=$DESCRIPTION extra_class="wysiwyg"} + {render_form_field form=$form field="description" value=$DESCRIPTION extra_class="wysiwyg"}
diff --git a/templates/backOffice/default/includes/product-general-tab.html b/templates/backOffice/default/includes/product-general-tab.html index 6d26a9ed5..6628d55c4 100644 --- a/templates/backOffice/default/includes/product-general-tab.html +++ b/templates/backOffice/default/includes/product-general-tab.html @@ -71,24 +71,15 @@ {/form_field} - {form_field form=$form field='brand_id'} -
+ {custom_render_form_field form=$form field='brand_id'} + - - - {loop name="brand-list" type="brand" visible="*"} - - {/loop} - - - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} + {loop name="brand-list" type="brand" visible="*"} + + {/loop} + + {/custom_render_form_field} {form_field form=$form field='visible'}
diff --git a/templates/backOffice/default/includes/seo-tab.html b/templates/backOffice/default/includes/seo-tab.html index 490078132..4fbbb3169 100644 --- a/templates/backOffice/default/includes/seo-tab.html +++ b/templates/backOffice/default/includes/seo-tab.html @@ -16,26 +16,21 @@ {form_hidden_fields form=$form} - {admin_form_field form=$form name="success_url"} + {render_form_field form=$form field="success_url"} {* Display error message if exist *} {include file='includes/notifications.html' message=$form_error_message} - {form_field form=$form field='url'} -
- - {admin_form_field_label form=$form name='url'} - -
- {$url_language|default:{config key="url_site"}}/ - -
+ {custom_render_form_field form=$form field='url'} +
+ {$url_language|default:{config key="url_site"}}/ +
- {/form_field} + {/custom_render_form_field} - {admin_form_field form=$form name="meta_title"} - {admin_form_field form=$form name="meta_description"} - {admin_form_field form=$form name="meta_keywords"} + {render_form_field form=$form field="meta_title"} + {render_form_field form=$form field="meta_description"} + {render_form_field form=$form field="meta_keywords"} {include file = "includes/inner-form-toolbar.html" diff --git a/templates/backOffice/default/includes/standard-description-form-fields.html b/templates/backOffice/default/includes/standard-description-form-fields.html index 2072d83df..04337cad7 100644 --- a/templates/backOffice/default/includes/standard-description-form-fields.html +++ b/templates/backOffice/default/includes/standard-description-form-fields.html @@ -1,6 +1,6 @@ {* The standard description fields, used by many Thelia objects *} -{admin_form_field form=$form name='title'} -{admin_form_field form=$form name="chapo"} -{admin_form_field form=$form name="description" extra_class="wysiwyg"} -{admin_form_field form=$form name="postscriptum"} \ No newline at end of file +{render_form_field form=$form field='title'} +{render_form_field form=$form field="chapo"} +{render_form_field form=$form field="description" extra_class="wysiwyg"} +{render_form_field form=$form field="postscriptum"} \ No newline at end of file