• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Ajax File Upload how to enhance the view?

Hi,

I'm working with the file upload plugin and I'm stock with some issues.

I would like to show use the Ajax file upload and the "Download script" to download the files in "list view" and "detail view". When I set "Use Download Script" to both or in a specific view the files are hide behind a download button.
Fabrik - list file upload2.png

In the previous illustration the clients will not be able to know which files to download. The behaviour that I would like to get is something like next picture so we can see the files name :
Fabrik - list file upload.png
I came to figure out that what I'm looking for is not possible with Fabrik so I would like to manually embed the files name, to make them downloadable with a download php files... something like that : /plugin/download.php?=<echo $... ?>, but I'm not quite certain where I need to look for...

I follow this two wiki and the video
I tried to override the /components/com_fabrik/views/list/tmpl/bootstrap, but I think I'm not in the right place...

The other thing that I would like to change is the orientation of the uploaded files. I would like to see the last uploaded files on top of the list and not at the bottom.

It would be very appreciated if someone could guide me.

Thanks for your time :D
 
The upload element uses JLayouts, which are like mini-templates. These can be overriden, see the wiki for how:

http://fabrikar.com/forums/index.php?wiki/jlayouts/

In this case the layout you need is:

./plugins/fabrik_element/fileupload/layouts/fabrik-element-fileupload-downloadlink.php

If you copy that file to ...

./templates/<yourtemplate>/html/com_fabrik/layouts/com_fabrik

you can edit it to display the download link how you want. That will override all uses of the download link, if you only want to change it for this element, put the file in ...

./templates/<yourtemplate>/html/com_fabrik/layouts/com_fabrik/elements/<yourtable___yourelement>

... obviously replace <template> with your J! template, and <youtable___yourelement> with the full element name.

You will have to update from github to pick up a change I just made, which adds the filename to the data we pass to the layout, which will then be in $d->file. You can get then get the base filename with ...

$basename = basename($d->file);

... and then use that instead of the icon for the display.

-- hugh
 
Thanks for your quick answer.

This afternoon I find out that all the download button bring the same link in "Detail view" when I set to "Yes" the "Use Ajax upload" field with "Use Download Script" with "both" or with "detail view only". Otherwise, if I set to "list view only" or "both" I will be able to download individually the files when I'm in a list view. So the error only occurs in "Detail view".

At first I was thinking that it was my override, so I decide to wipe out everything with a fresh github install, but the problem still persists.

For my quest to have a readable link with or without a button... I must say that I have hit a wall. With the follow script I'm able to see the file name in a "Detail view", but in a list view I'm unable to call the filename, so when I'm using the debog mode I can see the href with the download link, but filename will not echo. I also try to bring a " else if " to set this option only when we have more than one file, but even after reading fileupload.php in plugins/fabrik_element/fileupload and try many combinations I was not able to make it work. I still have some php skill to learn, at least I have tried!



<?php
defined('JPATH_BASE') or die;

$d = $displayData;

$class = $d->downloadImg !== '' ? '' : 'class="btn btn-primary button"';

?>

<?php if (!$d->canDownload) : ?>
<img src="<?php echo $d->noAccessImage;?>"
alt="<?php echo FText::_('PLG_ELEMENT_FILEUPLOAD_DOWNLOAD_NO_PERMISSION'); ?>" />
<?php else :?>
<a href="<?php echo $d->href;?>" <?php echo $class; ?>>
<?php if ($d->downloadImg !== '') : ?>
<img src="<?php echo $d->downloadImg;?>" alt="<?php echo $d->title;?>" />
<?php else :?>
<?php echo FabrikHelperHTML::icon('icon-download icon-white') . ' ' . FText::_('PLG_ELEMENT_FILEUPLOAD_DOWNLOAD');?>
</a>
<a href="<?php echo $d->href;?>" alt="<?php echo $d->filename;?>"> <?php echo $d->filename;?>
</a>
<?php endif; ?>
<?php endif; ?>
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top