1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

Image databese join

Jun 15, 2019
Image databese join
  • Introduction
    If you have list of car-images you might have 20 pictures of Mercedus, SL500. And if there is another table about car-brands it is not often desired to upload many photos as you can do with AJAX-uploads. You want for example the nicest picture of that model in the detail-view tamplate of that model.

    Database-join instead of image-element
    Instead of making an image or upload-element you can make a db_join element.
    You can select the id as value and the name "Or Concat Label" as label, but you won't show this element in your template. Also you have to create a filter: WHERE {thistable}.id = {cars___carbrand_raw} on EDIT and the carbrand element on ADD only.

    As followed you create a calc-element to calcultate the URL of the picture that belongs to the value (ID) of your db_join. And that result you will show in your detail-view template. And you can also pre-fix the URL of the element in order to show the Thumbnail instead.

    The author can write information in the form about Mercedes SL500 and select via the db_join the nicest picture based on the Concat label. And because of the WHERE filter the other car models will not be shown.