Fetch image by using {placeholders} in url

mbevc1

Member
Hi,

It is possible to fetch image on server using {placehoders} (as Fabrik element).

Example with image element, ...

or I will need some custom coding here?

Thank you
 
If you can more fully explain what you're trying to do, maybe I can come up with a solution for you.
Are you already using an image element and want a one-click solution for downloading the image itself?

If you are using a Fabrik image element, you can use the 'Link' option in the element configuration form to trigger an action when the image is clicked.
Then you can use this javascript code (in the form_##.js file) to change that link to be a direct download link to the image...
JavaScript:
jQuery('.imagedisplayor').load(function() {
    var img_src = jQuery(this).prop('src');
    jQuery(this).closest('a').removeProp('target').prop({'href':img_src,'download':''});
}).each(function(){
  if(this.complete) {
    jQuery(this).trigger('load');
  }
});
I have used this code to do that anyhow.:cool:

But that HTML 5 solution will only work in modern browsers (not supported by Safari)

If that doesn't work see... http://stackoverflow.com/questions/6796974/force-download-an-image-using-javascript
The HTML 5 solution is the easy route, otherwise you have to try one of the other solutions as explained in that link to force a download.

You could implement that either via a separate calc element or some javascript similar to the example above.
 
Last edited:
Thank you for your help. I will go through tomorrow ...

My needs are explained here:

1. In the real word we create an inventory of items in warehouses; someone also creates photos of all items.

2. We put these photos on FTP server (localhost)

3. We have all these items in fabrik in a list (id, item_name, item_desc, item number, item_category)

4. We need an new element in list (which will display these images on ftp: <img src=?..?>)

5. We want to rename images names on ftp in order to match it with selected element in lists; for example:

{item_name}-{item_category}-{item_number}.jpg

the image file name will look something like this: chair-kitchen-23444.jpg

Basically we need to automatically show images in list view (after bulk upload to ftp), without the need of uploading each image to list (via file upload plugin).



Thank you very much.
 
I'll have to test if you can access the ftp folder using the Fabrik image element if it is outside your web root. I know that didn't work when I needed to do it 3 years ago - but that may have been changed/fixed.

I'm still not clear on what you mean by 'we' in some of your list items. Does the user ever upload the images, or are these all uploaded by your organization via ftp, outside the web? Do you also need a user interface for uploading images - or just to view them? Do you want the user to be able to download the image or just view them? Will there be multiple images for one row/record in the list?

I'm trying to figure out if this isn't a chicken/egg thing - where you are looking for some sort of admin interface for you ('Special' users in your organization) to rename existing images and/or something to handle future imports of images from normal Joomla users - or both?

If you're looking for a way to just be able to select/view existing images - and save them as renamed files in the format you show - its will be easy to do using the Fabrik image element plugin and either a post-processing php script using the php form plugin, or even just a simple calc element - so long as each image has a unique record in the list. If there is some sort of one to many relationship it will be a little more difficult.
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top