Image File form field type

edited March 2016 in Bug Reports
Hi admin,
-----------------------------------------------------------------
this is my field definition

$fields['logo_image']['class'] = 'asset_select images/clients';
$fields['logo_image']['file_name'] = '{name}';
$fields['logo_image']['upload_path'] = assets_server_path('clients', 'images');

first problem :
file name changed to name.png , while I want it to take value of field named 'name'

second problem :
upload path and selection path is still images folder , while I want it images/clients folder
----------------------------------------------------------------------------
before this I had field named 'logo'
$fields['logo'] = array('type' => 'file' , 'is_image'=> TRUE , 'file_name'=>'{name}' , 'required' => TRUE , 'create_thumb' => TRUE);
this definition doesn't make preview for image , and doesn't make buttons "upload asset" & "select image" , it just show usual "select file" button of browser style
----------------------------------------

my fuel version is 1.3
Thanks for your time

Comments

  • edited 1:22PM
    I would first try updating to the 1.3.1 master branch or the develop branch because I think there were some fixes regarding that in there. Also for the asset selection path, you can use the "folder" parameter and set it to "folder" => "images/clients"
  • edited 1:22PM
    Thanks for your response
    I have another problem
    If I want to create two versions of a page for multilanguage reason , I can't use the same location
    also I have a form , how can I localize its labels
    thank you
  • edited 1:22PM
    If you are wanting to create a multi-language site, I'd reference this area in the documentation:
    http://docs.getfuelcms.com/general/localization

    If you are using Form_builder for your form (say as a simple module), you can create a language file and load it (perhaps via autoload) with language keys off:
    $lang['form_label_{field_name}'] = '....';
    http://docs.getfuelcms.com/libraries/form_builder
  • edited 1:22PM
    Sorry , there is misunderstanding
    the form I created using form module in admin panel , admin/forms/
    for localization , in the manual ,
    http://localhost/about/history?lang=es
    so I can create a multi version of "pages"
    http://localhost/about?lang=es
    http://localhost/about?lang=en
    http://localhost/about?lang=ar
    but "pages" said that location is duplicated even if the language is different
    in the manual "Each page location can have multiple languages assigned to it" , how can I make that with admin panel "pages" , I think if there is a "translate" link it will be more helpful
    thank you
Sign In or Register to comment.