Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » [archived] mrz_file_preview

#1 2005-07-30 16:19:05

marz
Archived Plugin Author
From: Barbados
Registered: 2004-11-13
Posts: 43
Website

[archived] mrz_file_preview

Notice: This plugin is no longer available.

**********************************************************

Inspired by the idea from Chris Campbell , who was inpired by the TargetAlert extension for Mozilla firefox, this plugin will place an icon unobtrusively next to your file link, indicating what file type lies behind the link.

Download & Documentation

<br />

Download Here
Related Post

How To Use

<br />

Just place the <txp:mrz_file_preview /> (will show a single file wrapped in a div tag) or <txp:mrz_file_preview_list /> (presents a list of files in ol or ul tags) tag wherever you want in your article or article form. The file list can be filtered by ID, Category, Filename or No. of downloads. You can see an example of the output here

<h2>Tags</h2> <br /> <p> <strong>mrz_file_preview</strong> – Will display a file with an icon preview <br /> <strong>mrz_file_preview_list</strong> – Will display a list of files with the icon preview next to it </p> <table summary=“Plugin Attributes”> <caption style=“font-size: larger;”>mrz_file_preview</caption> <tbody> <tr> <th colspan=“1”>Attribute</th> <th colspan=“1”>Description</th> <th colspan=“1”>Default</th> <th colspan=“1”>Required</th> </tr> <tr style=“height: 30px;”> <td>id</td> <td>The id of the file to display.</td> <td>None</td> <td><span style=“color: red;”>Yes</span></td> </tr> <tr style=“height: 30px;”> <td>form</td> <td>The form used to display the information</td> <td>files</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>wraptag</td> <td>Wraps the output in the tag</td> <td>div</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>class</td> <td>Class assigned to the wraptag <br /> <span style=“color: #aaa;”>Note:If class is set to ‘’, the file extension will be used as the class.</span></td> <td>file-prev</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>sep</td> <td>Places the given text between the class and the file extension</td> <td>-</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>iconsize</td> <td>Size of the image used as the icon <br /> <span style=“color: #aaa;”>Note: Don’t include the ‘px’ when setting this attribute</span></td> <td>48</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>padding</td> <td>Space between the image and the results <br /> <span style=“color: #aaa;”>Note: Don’t include the ‘px’ when setting this attribute</span></td> <td>5</td> <td>No</td> </tr> </tbody> </table> <br /> <table summary=“Plugin Attributes”> <caption style=“font-size: larger;”>mrz_file_preview_list</caption> <tbody> <tr> <th colspan=“1”>Attribute</th> <th colspan=“1”>Description</th> <th colspan=“1”>Default</th> <th colspan=“1”>Required</th> </tr> <tr style=“height: 30px;”> <td>id</td> <td>Comma separated list of ID’s to display.</td> <td>None</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>category</td> <td>Accepts a comma separated list of categories</td> <td>None</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>limit</td> <td>Limits the maximum number of results to display</td> <td>None</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>sort</td> <td>Which direction to sort the output. ASC (for Ascending) or DESC (for Descending).</td> <td>DESC</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>sortby</td> <td>Which field to sort the list on. Valid options are: filename, id, category and downloads.</td> <td>filename</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>type</td> <td>Accepts a comma separated list. Filters out files which aren’t of the types given</td> <td>None</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>form</td> <td>The form used to display the results</td> <td>files</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>wraptag</td> <td>wraps the list in the given tag <br /> <span style=“color: red;”>Only accepts <code>ul</code> or <code>ol</code></span></td> <td>ul</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>listclass</td> <td>Class assigned to the wraptag</td> <td>file-list</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>class</td> <td>Class assigned to the li tag <br /> <span style=“color: #aaa;”>Note:If class is set to ‘’, the file extension will be used as the class.</span></td> <td>file-prev</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>sep</td> <td>Places the given text between the class and the file extension</td> <td>-</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>showcount</td> <td>Shows a file count in the header. Set it to ‘1’ to show a header or ‘0’ to hide.</td> <td>0</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>showheader</td> <td>Shows a header for the file list. Set it to ‘1’ to show a header or ‘0’ to hide.<br /> <span style=“color: #aaa;”>The header shown will be the name of the given category or ‘File List’. <br /> You change it using the ‘header’ attribute.</span></td> <td>1</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>header</td> <td>Gives the list a custom header</td> <td>category name / ‘File List’</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>headerlvl</td> <td>XHTML heading tag level (1,2,3,4,5 or 6).</td> <td>4</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>headerclass</td> <td>Assigns a class to the header</td> <td>‘file-header’ / file-categoryname</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>iconsize</td> <td>Size of the image used as the icon <br /> <span style=“color: #aaa;”>Note: Don’t include the ‘px’ when setting this attribute</span></td> <td>48</td> <td>No</td> </tr> <tr style=“height: 30px;”> <td>padding</td> <td>Space between the image and the results <br /> <span style=“color: #aaa;”>Note: Don’t include the ‘px’ when setting this attribute</span></td> <td>5</td> <td>No</td> </tr> </tbody> </table>

Last edited by marz (2005-08-01 22:19:02)

Offline

#2 2005-07-31 05:44:55

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [archived] mrz_file_preview

Hey this looks good. Will try this out for sure.

Thank you very much!

Last edited by creativesplash (2005-07-31 05:45:14)


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#3 2005-08-01 03:41:32

marz
Archived Plugin Author
From: Barbados
Registered: 2004-11-13
Posts: 43
Website

Re: [archived] mrz_file_preview

Update to Version 0.2

<br />

Rewrote the existing functions. No longer using TXP’s doWrap and doTag. They make things cumbersome at this point.

Added the mrz_file_list_preview tag

Restricted the mrz_file_list_preview tag to use only ol and ul as wraptags.Working on allowing different wraptags and breaktags.

Removed the ‘Core Settings’ from the previous version. All settings can be changed from the tag using the attributes.

Download

Last edited by marz (2005-08-01 22:11:26)

Offline

#4 2005-08-01 22:02:58

marz
Archived Plugin Author
From: Barbados
Registered: 2004-11-13
Posts: 43
Website

Re: [archived] mrz_file_preview

Update to version 0.3

<br />

Fixed wraptag not getting the correct class in mrz_file_preview_list

Allowed category attribute in the tag mrz_file_preview_list to accept a comma separated list.

Added the type, sort and sortby attributes.

Download

Last edited by marz (2005-08-01 22:11:06)

Offline

#5 2005-08-16 15:25:10

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: [archived] mrz_file_preview

I assume we add our own image through CSS to the class that is automatically assined?

Also, I would like to be able to turn off classes on the header and list wraptag like so: headerclass=”“ , listclass=”“. If these are set like this then no class shows up in the markup.

Offline

#6 2005-08-16 16:32:29

marz
Archived Plugin Author
From: Barbados
Registered: 2004-11-13
Posts: 43
Website

Re: [archived] mrz_file_preview

<blockquote>I assume we add our own image through CSS to the class that is automatically assined?</blockquote>

Yep. Heres my css (for the plugin tag I set listclass=“icon-list” and class=”“):
<pre><code>ol.icon-list, ul.icon-list { padding: 0; }

ol.icon-list li, ul.icon-list li
{ margin: 0 0 2.3em 0; background-repeat: no-repeat; background-position: left;
}

.icon-list li.php { background-image: url(/assets/images/icons/php.png); }

.icon-list li.txt { background-image: url(/assets/images/icons/txt.png); }

.icon-list li.css { background-image: url(/assets/images/icons/css.png); }

.icon-list li.js { background-image: url(/assets/images/icons/js.png); }

</code></pre>

<blockquote>Also, I would like to be able to turn off classes on the header and list wraptag like so: headerclass=”” , listclass=””. If these are set like this then no class shows up in the markup.</blockquote>

I’ll do this and update the plugin asap.

Offline

#7 2005-11-28 11:03:52

Vitruvius
Plugin Author
Registered: 2004-09-21
Posts: 125

Re: [archived] mrz_file_preview

I have just posted a thread in the feature requests forum that this plugin could be developed to solve.

The request is to add more sort features to file lists. Specifically to sort by date (be it date uploaded – which is currently not recorded, or date modified – which is??)

Anyway – I thought I’d ask marz to see if you have any idea how this might be achieved.

(Great plugin BTW – it has def. come in handy!)

SH

Offline

#8 2005-11-28 11:52:54

Vitruvius
Plugin Author
Registered: 2004-09-21
Posts: 125

Re: [archived] mrz_file_preview

mmm – I should have seems the solution was staring me in the face…

Offline

#9 2006-07-13 08:25:24

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: [archived] mrz_file_preview

(Another dead-links plugin thread)

If anyone has the latest version of this plugin file, and it works with the latest version of Txp, would you be so kind as to add it to the Plugin Archives

Thank you.

Offline

#10 2008-12-27 12:36:47

manncj
Member
From: Buckinghamshire, England
Registered: 2007-10-23
Posts: 48
Website

Re: [archived] mrz_file_preview

the website to download this plugin does not seem to work…any ideas???

Offline

#11 2008-12-27 13:26:38

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: [archived] mrz_file_preview

Chris, look at the dates of the posts above yours – this plugin died years ago.


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

  1. Index
  2. » Archives
  3. » [archived] mrz_file_preview

Board footer

Powered by FluxBB