Skip to content

[Enhancement]: Possible addon to File_util.php and file.stub #103

@phillipmadsen

Description

@phillipmadsen

Should configure file.stub to use preview and path with extension for the file field.

{
    "fieldInput": "attachment:string",
    "htmlType": "file",
    "usePath": "public|storage",
    "pubPath": "/uploads/%MODALNAME%/%FIELDNAME%",  
    "storagePath": "/%MODALNAME%/%FIELDNAME%",
    "validations": "JPG,GIF,PNG",
  /*  "example sizes": "sizelabel:{primary_image}:width:{700},height:{300} ," */
    "sizes": "primary_image:700,300 thumbnail:250,250 admin_image:1200,500",
    "searchable": true,
    "fillable": true,
    "primary": false,
    "inForm": true,
    "inIndex": false
},

_My stub would generates something like this:_

<tr>
    <td style="width:20%">
        <a href="http://placehold.it/1000x600?text=Admin+View" class="magnific" title=" ">  //large image
             <img src="http://placehold.it/300x180?text=Admin+thumb" alt=" " class=" ">  // preview in form image
        </a>
    </td>
    <td><input type="text" class="form-control m-t-10" value="{%FIELD_NAME%-IMAGE}" ></td>
    <td><input type="checkbox" name="{primary image}" value="1" class="m-t-10"></td>
    <td><input type="checkbox" name="{thumbnail}" value="1" class="m-t-10"></td>
    <td><input type="checkbox" name="{admin_image}" value="1" class="m-t-10" checked></td>
    <td class="text-center">
        <a href="#" class="delete-img btn btn-sm btn-default m-t-10"> <i class="fa fa-times-circle"></i>
         Remove
        </a>
    </td>
</tr>

file stub concept

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions