Dropex

Developer

Yoursort - Lars Bilke

3rd Party (Commercial)
Current Version: 2.0.0

License Agreement

Buy Now!

$50.00
Qty:

EE Version Support

  • ExpressionEngine 2

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

Dropex integrates your Dropbox into any ExpressionEngine site. You can list files from any folder and download them directly. **NEW 2017/09**: Updated for Dropbox API v2! For discounted multi-site licenses see https://gum.co/dropex

A Dropbox ExpressionEngine plugin which is based on DropPHP by Fabian Schlieper. Dropex is available on Devot-EE.

You can list files from your Dropbox:

Clicking on a file directly downloads the file or directs you to the Dropbox file preview:

Together with an additional add-on you can put a simple Dropbox file browser on your ExpressionEngine site:

Installation

  • Download this plugin and put its files in system/expressionengine/third_party/dropex and themes/third_party/dropex
  • Create a new Dropbox application
    • Choose Dropbox API (Business API is not tested)
    • Choose between App folder or Full dropbox access
    • After app creation note App key and App secret
    • Fill in the redirect URL: should be e.g. https://example.com/index.php or http://localhost/index.php for local development. Click the Add-button.
  • Rename the file system/expressionengine/third_party/dropex/DropboxCredentials.php.sample to system/expressionengine/third_party/dropex/DropboxCredentials.php
  • Make sure the system/expressionengine/third_party/dropex/tokens-folder is writable
  • Fill in your Dropbox application credentials in the file DropboxCredentials.php

    • If your Dropbox application has full access to your Dropbox change the second line DropboxCredentials.php to

        $dropbox_full_access = true;
      

Authorization

When you first access a page which uses this plugin you will be redirected to Dropbox to authorize this application. This will create the token-files in the tokens/-folder.

Dropex Files Tag

Introduction

This document describes the {exp:dropex:files} tag pair.

Parameters

base_folder=

base_folder="some/base_folder"

Default to /. This is the root folder you want to display. If your app has full Dropbox access this is relative to your Dropbox root folder, otherwise it is relative to your Dropbox app folder (e.g. apps/your_app_name).

folder=

folder="some/folder"

Defaults to /. This folder is appended to the base_folder. Files from this appended folder are listed.

recursive=

recursive="yes|no"

Defaults to no. List files and folders recursively. All items (folders and files) are displayed in alphabetical order. Be aware that this can really slow down the sites response time when you have many files!

order_by=

order_by="type|name"

Defaults to name. When order_by=“type” folders are listed before files. This is only available when recursive=“no”.

preview=

preview=

Defaults to no. If preview=“no” then the listed files can be directly downloaded. Otherwise you get directed to the Dropbox preview page of that file (if available for that file type).

Single variables

Provides the URL to the parent folder. See the simple file browser example.

{if back_link}<a href="{back_link}">Back</a>{/if}

Variable pairs

files

The {files} tag pair iterates over a list of files and folders. Its variables are:

name

The name of the file (without path).

full_name

The name of the file with path.

This is either the preview or the direct download link. See the preview-parameter.

is_dir

Is “yes” when current item is a folder. Is “no” otherwise.

size

The size of the file in bytes. Is only defined on files.

size_kb

The size of the file in kilobytes. Is only defined on files.

time

The timestamp of the last file modification. Is only defined on files.

image

Inserts an image depending on the file type (24x24 px). Note that there are not images for all file types available.

image_small

Inserts a small image depending on the file type (16x16 px).

Example

This example simple lists all files folders from the given base_folder:

{exp:dropex:files base_folder="some/folder"}
    <ul>
    {files}
        <li>{image_small} <a href="{link}">{name}</a> {if size}({size}){/if} {if time}{time}{/if}</li>
    {/files}
    </ul>
{/exp:dropex:files}

Simple file browser example

The following example shows a simple file browser implementation. This example does not work on default templates in a template group (the url has to be like www.site.com/index.php/template_group/template_name) and you also need the Mo’ Variables add-on installed. In the add-on please enable the Segments Starting From X-variables.

{exp:dropex:files base_folder="some/folder" folder="{segments_from_3}" order_by="type"}
    {if back_link}<a href="{back_link}">Back</a>{/if}
    <ul>
    {files}
        <li>{image_small} <a href="{link}">{name}</a> {if size}({size}){/if} {if time}{time}{/if}</li>
    {/files}
    </ul>
{/exp:dropex:files}

The folder=“segments_from_X” parameter depends on your URL structure where X is the URL segment number of your current template (see the EE-docs for an explanation) plus 1. So if your template url looks like http://www.mysite.com/index.php/template-group-name/template-name then the current segment is the second. 2 plus 1 = 3 so you have to use segments_from_3.

Performance tips

For a much improved site response time use the ExpressionEngine tag caching. The following example will cache the Dropbox file list for 30 minutes:

{exp:dropex:files base_folder="some/folder" cache="yes" refresh="30"}
  ...
{/exp:dropex:files}

Tested configuration

  • PHP 7.1.8
  • MySQL 14.14
  • ExpressionEngine 2.11.9
    • Mo’ Variables 1.3.2

This entry was created February 11, 2013, 9:20 am.
This entry was last updated September 21, 2017, 3:34 pm.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

There are no reviews for this add-on yet.

What are you waiting for? Rate it and review it!