This is a simple plugin to list files in a given directory using this shortcode: [MMFileList /].
Parameters:
Output:
For all html formats you can expect to see the following output wrapped in styleable containers:
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:
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.
Starting from $0 per month.
Rating
Reviewers
19 reviews
Tags
Developed By
Adam Bissonnette
Quick & Easy
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 plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Simplify the Checkout Process and Boost Sales
Increase Trust & Improve Credibility To Drive Sales Up
Add Audio Player to Enrich & Promote Your Website Content
Increase Customer Confidence with Customizable Trust Badges
Showcase Employee Feedback with Glassdoor Reviews Widget
Improve visibility & Increase attendance with the Events List Widget
Engage, Alert, and Convert with Innovative Notifications
Improve User Experience & Increase Conversions With an Info List
Enhance Global Shopping Experience with Currency Converter
Create Stunning Twitch Feeds & Improve User Experience
Build Fun and Custom Leaderboards to Boost Competition
Increase Trust & Improve Credibility To Drive Sales Up
More plugins
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!