Mmm Simple File List

Mmm Simple File List

Wordpress plugin

Install on Wordpress

App Details

This is a simple plugin to list files in a given directory using this shortcode: [MMFileList /].

Parameters:

  • folder: Relative to the base uploads directory of your wordpress install (e.g. siteurl.com/wp-content/uploads/mm/yy/ or siteurl.com/wp-content/ or siteurl.com/media). You can check your media settings from your WordPress dashboard in Settings -> Media. If you organize your uploads in the WordPress default month / year base folder you should either prepend this field with “/../../” or disable that setting before uploading files.
  • format: Tabular (format=”table”) or Unordered list (format=”li”) or comma-delimited (format=”comma”) or Unordered List of Images (format=”img” Note: this will put all files in tags) or Custom (format=”custom”) for using the Shortcode content to create a custom template (see Custom Formats section below for more information)
  • types: Only list given file types (e.g. types=”pdf,doc,txt”), If no types are specified then all files in the directory will be listed.
  • class: Only used for the “li”, “img” and “table” formats, applies a given class to the shortcode output (e.g. <ul class=”mmm-list”> / for more information on styling check out the FAQ)
  • limit: The default value will list all files in the directory. You can add a positive number of your choice and that amount of files will be displayed.
  • orderby: Current params can be either “name” (default) or “date” which sorts the files by date modified since date created seems to be hit and miss.
  • order: By default the order of the list is sorted descending (desc) from the highest value to lowest where value is determined by the “orderby” attribute. Ordering by date results in a list being displayed as newest to oldest and ordering by name results in a list descending through the alphabet (a-z). To reverse either of these defaults simply add order=”desc” into the shortcode parameters
  • target: This parameter lets you set a “target” for the links to the listed files (This is typically used to open the files in a new window)
  • prettyname: This replaces underscores and dashes with spaces and removes the file extension from the filename.
  • removesize: This removes the filesize from the default output
  • removeextension: This removes the file extension (leaving underscores and dashes)
  • regexstrip: Feeling like a wizard? Why not put in your own regex to strip out whatever you want from the filenames (no warranty provided, use proper formatting e.g. regexstrip=”/e/” will replace all e’s in the filename!)
  • regexreplace: Want to replace that content with something other than a blank space? Add whatever you want here to work with the regexstrip function
  • regexfilter: Filter out filenames that match a given regex pattern (See usage examples for more info)
  • regexfilterinclusive: Instead of picking out a few files to exclude you can use this to parameter to include anything that you want (See usage examples for more info)
  • dateformat: Adjust the format of the {date} variable in custom templates
  • headings: Adjust the headings of the table format by entering a comma delimited list
  • usecwd: If you can’t get the wp_upload_dir() folder to work you can try setting this to true to use your current working directory instead which should be your public_html folder

Output:

For all html formats you can expect to see the following output wrapped in styleable containers:

  • Filename (linked to the File Url)
  • File Size

At this point “comma” is the only available text output and it only outputs the url to the file in a comma delimited list (no links – just text).

If the folder you’ve entered isn’t found or there are no files with the extensions you’ve listed there will be some warning text output to let you know. This text is wrapped in a “mmm-warning” class in case you want to style it out (for more information on styling check out the FAQ)

Usage Examples:

Let’s say you’re using the default WordPress Media settings so we can expect your uploads folder to be in /wp-content/uploads/mm/yy/ with this in mind the shortcode “folder” attribute will look in a directory relative to this. With this base directory say we want to list “png” files in the folder “/wp-content/uploads/cats/” we would use the following shortcode:

[MMFileList folder=”/../../cats/” format=”table” types=”png” /]

If you have you disabled the setting to store uploads in the /mm/yy/ folder structure (you can do this within Settings -> Media) and wanted to display that same file you would use this shortcode:

[MMFileList folder=”/cats/” format=”table” types=”png” /]

This will result in a tabular list of all .png files in the /wp-content/uploads/cats/ folder.

Custom Formats

The “li” and “custom” formats allow you to define a template using the content portion of the shortcode. The difference between these two output formats is that “li” will still wrap all the output in a <ul> tag and each file will be wrapped in a <li> tag. Here is an example of how to create a custom template:

[MMFileList folder=”/cats/” format=”li”]<div class=”taco”><a href=”{url}”>{name} ({size})</a></div>[/MMFileList]

Variables that can be used with the custom templates are as follows:

  • {name} – This will output the filename
  • {size} – This will output the filesize
  • {url} – This will output the file url
  • {date} – This will ouput the file’s last modified date (use the format parameter to customize how this looks!)
  • If you would like more information available to be output don’t hesitate to a send in a request via the support forum

Regex and List Filtering

Regex or Regular Expressions are a really powerful tool but can seem intimidating at first. If you’re uncomfortable or having trouble feel free to reach out on the forums. For testing / trying to build your own pattens I recommend using https://regex101.com/ – it’s my goto. As a general rule for this plugin the pattern needs to be written with slashes /likethis/ for it to work. With regex the general rule is to try to keep things simple.

Using the regexfilter parameter you can exclude or include only specified files.

Let’s say you have a list of cat pics you want to share but you have both dog and cat photos in the same folder. Luckily for you – they’re still labeled name-cat.jpg or name-dog.jpg. You can use the regexfilter feature to help with your predicament.

The following will EXCLUDE all files with the word doc in them.
[MMFileList folder=”/myanimalpics/” regexfilter=”/dog/” /]

Another feature is the regexfilterinclusive option. Say for some reason your cousin Larry added a bunch of dog and frog photos to the folder but didn’t follow your naming conventions (dangit Larry!) well – have no fear. As long as you have a patten that matches your cat photos you can use this regexfilterinclusive toggle to show only those files.
[MMFileList folder=”/myanimalpics/” regexfilter=”/cat/” regexfilterinclusive=”1″ /]

Note: that regexfilter is done before regexstrip and another filename changes (e.g. pretty name, file size/file name removal etc…) so if you’re having trouble this might be part of the issue. Base your pattern on the original filename and you should be good.

Using regexstrip allows you to remove text that matches a given pattern and regexreplace allows you to put in other text instead of just blank space. These are fairly advanced so I wouldn’t recommend using them unless you really know what you’re doing.

Pricing

Starting from $0 per month.

Check Out the PayPal Donate Button Widget

By Common Ninja

PayPal Donate ButtonTry For Free!

App Info

Rating

Reviewers

19 reviews

Tags

File List
shortcode

Developed By

Adam Bissonnette

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Maps

Maps plugins for Wordpress

Translation

Translation plugins for Wordpress

Chat

Chat plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Contact

Contact plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Forms

Forms plugins for Wordpress

Comments

Comments plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Comments

Comments plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Video Player

Video Player plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Security

Security plugins for Wordpress

Ads

Ads plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Membership

Membership plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

PayPal Donate Button for Wordpress logo

PayPal Donate Button

Make it easy for supporters to contribute using PayPal or Stripe by adding a donation button that keeps giving fast, secure, and on site.

Consent Form for Wordpress logo

Consent Form

Create consent forms that collect signatures, save submissions, send notifications, and help you manage approvals efficiently.

Image Hotspot for Wordpress logo

Image Hotspot

Add interactive image hotspots to your site to turn static visuals into clickable guided experiences that improve engagement.

Image Gallery for Wordpress logo

Image Gallery

Showcase photos with an image gallery that displays pictures and captions in grids, improves design, and boosts visitor engagement.

Flash Cards for Wordpress logo

Flash Cards

Create interactive flash cards that present questions and answers in a clear, customizable format to support learning, training, and user engagement.

Right Click Protection for Wordpress logo

Right Click Protection

Use right click protection to prevent copying by disabling right click actions, protecting your content and reducing unauthorized reuse on your site.

Skill Flip Cards for Wordpress logo

Skill Flip Cards

Use skill flip cards to showcase your abilities in a clear, interactive format that strengthens your profile and improves your chances of getting hired.

Social Proof Avatars for Wordpress logo

Social Proof Avatars

Display social proof avatars that show user activity and ratings, build trust instantly, and help visitors feel confident about your credibility.

X Feed for Wordpress logo

X Feed

Show posts in an X feed that keeps updates visible, improves content discovery, and helps visitors stay engaged with your latest activity.

Cookie Banner for Wordpress logo

Cookie Banner

Use a Cookie Banner to inform visitors about cookies on your site and let them manage their consent in a clear, structured way.

Device Mockup for Wordpress logo

Device Mockup

Show products, apps, or designs inside a clean device mockup that improves visualization, builds credibility, and helps visitors make confident decisions.

Google Reviews for Wordpress logo

Google Reviews

Show verified customer feedback with Google Reviews to build trust, strengthen credibility, and help visitors make confident purchase decisions.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms