Okay
  Public Ticket #955891
Displaying images in the table
Closed

Comments

  •  2
    elzanaty started the conversation

    Hello there,

    I love your plugin wpDataTables, documentation, video documentation.  I managed to setup my first table from my existing MySql Database. It is that easy but I ran into trouble trying to display images that are referenced in the database table.

    MySql table show data like this

    id   name     photo 

    1     Tom    tom_photo.jpg

    2     Sam    sam_photo.jpg

    etc...

    The actual files are stored on the same server in the following directories

    home/xyzaccount/public_html/apps/files/tom_photo.jpg

    home/xyzaccount/public_html/apps/files/tom_photo.jpg

    How do I get the images to show in the table? What should I do?

    Thank you in advance for your assistance.

    Ehab




  • [deleted] replied

    Hi elzanaty,
    Thank you for your purchase.

    You should have full link in photo column and set Image column type from that column in wpDataTables Optional Column Setup.

    Please provide me a temporary WP-admin login for your site, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check PRIVATE so nobody can see it except us.

  •   elzanaty replied privately
  • [deleted] replied

    Hi elzanaty,

    You should have full photo url to be able to preview it as image in table. In your query you can use Concat for photo column to join path of the images folder and image name.

    For example:

    CONCAT('your url ', studentint.student_photo)

     

  •   elzanaty replied privately
  • [deleted] replied

    Hi elzanaty,

    Yes it is possible. Please take a look at rendering rules in our documentation for Image column type - Link

    You are welcome. We'd greatly appreciate it if you could take a minute and leave a review on CodeCanyon on this link. Thanks! 

  •   elzanaty replied privately
  • [deleted] replied

    Hi elzanaty,

    Problem with search is related with MySQL tables. Probably because you are using Concat. You have to create MySQL View in phpMyAdmin from that query and use it as a table input. You can take a look here how to create MySQL View.

    You should concat image column so that you get something like this:

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

    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.

  •   elzanaty replied privately
  • [deleted] replied

    Hi elzanaty,

    You can upload thumbnail images directly in folder that you want and in structure:

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

    thumbnail will be shown in table and when you click on image it will show full image in light box.

    If you don't want to upload thumbnails in separate folder you can make that table editable and choose for image column Editor Input type attachment. After that you can edit that table with wpDataTables and upload images for image column. When you upload it WordPress will be automatically save 4 images with different sizes and in your database for image column value that will be saved will be:

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


  •   elzanaty replied privately
  • [deleted] replied

    Hi elzanaty,

    Can you send me a link where this table is located? Also as you are using MySQL based tabled, did you remove or add new columns after creating that wpDataTable first time?