Hey everyone!

With the holiday season upon us, we want to share our upcoming working hours:

After that, we’ll return to our regular schedule and assist you as quickly as possible.

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find tons of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel), which might just have the answers you need while we’re away.

Thanks a bunch for your understanding and support!

Warm regards and happy holidays!

TMS

Okay
  Public Ticket #3438755
Location to store image
Closed

Comments

  • Fietsmaatjes started the conversation

    For our users I would like to add a photograph to a WpDataTable. (Not to confuse with the picture in the WordPress profile.)

    When I add an 'image field' to our table, the image is stored in the media library, together with al the 'general purpose' images used in the website. Is it possible to change the location where an image is stored just for this table, or for WpDataTables in general?
    If so, can you also prevent that automatically other files are made with the different sizes?

  •  1,847
    Miloš replied

    Hi Fietsmaatjes,

    i am sorry to disappoint you, 

    but we are using WordPress function wp_upload_dir() for location of upload files;

    so if a user uses the 'upload attachment' in your Table inside our Plugin,

    it will use the default WP upload location.

    At the moment, we don't have a way to set it up in a way to say, for just one specific table,

    or for our Plugin only to set a different specific upload path during "file upload" function while having the 'regular upload path' for other functions on your site.

    You can make a development suggestion for this, though.

    At this time, we don't have any built-in solution to achieve this, but you can suggest it to our developers - they will do their best to make a solution in the future.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    -

    If you have coding skills and wish to try to make a custom solution now,

    you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.

    Please be advised that custom solutions with hooks are not included in our support.

    You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.

    ( We do like to give examples for certain solutions, but for this use-case, we, unfortunately, don't have anything yet)

    -



    2. If you wish to perhaps change the WP Upload location, there is a workaround :

    We are using WordPress function wp_upload_dir() for location of upload files. By default is set to the upload folder (wp-content/uploads). However, you should be able to change that location. On this link, you can see how to do that.

    But if you do this, then this would be the new default Upload location for the entire WP library, just to note that.



    3. If you wish to hide the Media Library from users,

    and have them just see their own files which they upload without seeing other people's files :

    Since we are using the WordPress function wp_upload_dir() for this, there are workarounds.

    Users and WP support have developed custom workarounds to hide the media library/ or at least limiting to see only the files which the particular user has already uploaded.

    For example, you can search for solutions similar to this one - here someone on Stack Overflow set up for users only to see their own uploads:

    https://stackoverflow.com/questions/28787575/wordpress-restrict-users-to-see-only-their-uploads

    or this one, where someone created a solution to visually hide the Media Library tab, and only left the "upload from local storage" tab for front-end users.

    https://wordpress.org/support/topic/upload-product-image-without-media-gallery/

    Also, you can change the default location where the files upload.

    . By default is set to the upload folder (wp-content/uploads). However, you should be able to change that location. On this link, you can see how to do that.



    4. Changing the default image size when uploading as attachment :

    This is one of the current "default behaviour" issues that our devs noted on our "Editor types" Documentation here, regarding the image column being used with attachment editor type.

    - If the Column type is set to Image, and the editor type as attachment, 

    the uploader will automatically insert a ‘thumb’ size in the table cell (the resolution is defined in WP config), and link it to a full-size image. 

    If you have a WP Lightbox 2 plugin installed, each image will automatically open in a lightbox.

    -

    If we don't use the "attachment" as the Editor type, for example, if we use one-line edit, or multi-line edit;

    then we can manually implement in the cell, if we wish a thumbnail, or the path to the full image without the thumbnail,

    - As we stated in this documentation about our Image columns;

    the specific rendering rules for image cells are

    : If the content of the cells contains a combination of “two sticks” – || – everything to the left of this combination is used as a link to the thumbnail, and everything to the right as a link to the full image size:

    http://domain.com/thumb.png||http://domain.com/fullsize.png

    If the “||” combination is not found in the content, the entire content will be used as a link to a full-size image.

    -

    So, unfortunately, this is the current limitation - you can try to change the default "thumb image upload" resolution is defined in WP config.

    - If you wish, you can read more details on how uploading image sizes works in WordPress here.

    I hope this helps.

    Let me know if you have any additional questions. Thank you

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables