1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Calc to image thumbs

Discussion in 'Community' started by jh, Aug 15, 2019.

  1. jh

    jh Member

    Level: Community
    Hi

    Ive been using a calc to return an image for a list from another list, this is all working fine. However I realised it should really be linking to the thumbnail image that is created.

    Using the code I currently have it returns the path eg:

    /images/item/**.jpg

    But I want it to return eg:
    /images/item/thumbs/**.jpg

    Note that I was using inline styling eg style="height:123px" but this is not how to reduce load times I guess.
    Tested fine in firebug but I dont know how to change the path to the thumbs folder, as I guess the element is only returning the main image uploaded?

    Thank you in advance for any assistance.

    Kind Regards
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    I don't know if you can access path and filename separately. But in any case you can do some string handling, replacing e.g. /item with /item/thumbs

    Gesendet von meinem SM-G930F mit Tapatalk
     
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Correct, the upload element only stores the main file path, you'd have to create the thumb path yourself. Either by replacing as per Troester's suggestion, or something like this, assuming $filePath contains '/images/item/foo.jpg' ...

    Code (Text):

    $thumbPath = '/images/item/thumbs/' . basename($filePath);
     
    -- hugh
     
  4. jh

    jh Member

    Level: Community
    Thank you both, have added the code and it is working perfectly :)
     

Share This Page