Skip to main content
  Friday, March 10 2017
  3 Replies
  1.8K Visits
  Subscribe
Single file shortcode to have a preview link appear just like the table display.


On one site we have about 70 categories and we find that we have to scroll down to find the category which may be a two to three page scroll then click on the category. after that click we need to scroll back to the top to see the files. I would like to request that you make the categories more like the wordpress page/post list display so they are sort-able and searchable / paginated so you click and go inside the category for management. it is very difficult to train a client to scroll three pages down then click the category and scroll back up three page to see if it displayed. if changing the current category display is out of scope please consider a second alternate display as an addon so we can manage over a 100 categories more efficiently.
A
7 years ago
Hi,

Thanks for adding your feature request here. We’ll keep that in mind for a future release!

Cheers,
P
7 years ago
digitaliway - I have hacked the plugin to show a preview link.

After the download link in tplsingle.php, I inserted the following code:


<?php if ($this->file->remote_url == false): ?>
<a href="/<?php echo $this->file->viewerlink ?>" class="openlink wpfdlightbox wpfd_previewlink" data-id="<?php echo $this->file->ID; ?>" data-catid="<?php echo $this->file->catid; ?>" data-file-type="<?php echo $this->file->ext; ?>" >
<img src="http://yoursite.com/wp-content/plugins/wp-file-download/app/site/assets/images/theme/preview.png"></a>
<?php endif; ?>


Obviously you will need to upload an icon as preview.png for it to show the preview button image.

And then in theme.php add the following lines under the showFile() function's lists of scripts:


wp_enqueue_style('wpfd-colorbox', plugins_url( 'app/site/assets/css/colorbox.css' , WPFD_PLUGIN_FILE ),array(),WPFD_VERSION);
wp_enqueue_style('wpfd-viewer', plugins_url( 'app/site/assets/css/viewer.css' , WPFD_PLUGIN_FILE ),array(),WPFD_VERSION);
wp_enqueue_script('wpfd-colorboxjs', plugins_url( 'app/site/assets/js/jquery.colorbox-min.js' , WPFD_PLUGIN_FILE ),array(),WPFD_VERSION);
wp_enqueue_script('wpfd-colorbox-init', plugins_url( 'app/site/assets/js/colorbox.init.js' , WPFD_PLUGIN_FILE ),array(),WPFD_VERSION);
wp_localize_script('wpfd-colorbox-init','wpfdcolorbox',array('ajaxurl' => Application::getInstance('wpfd')->getAjaxUrl()));


FYI this was for the last version before 4.0 so if you've already updated I'm not sure if this will work. I haven't updated yet because the new version broke our site.
  • Page :
  • 1
There are no replies made for this post yet.