rejetto forum
May 26, 2012, 12:31:32 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: MIME-type filter in [file] section  (Read 1052 times)
0 Members and 2 Guests are viewing this topic.
SamePaul
Experienced poster
***
Offline Offline

Posts: 70


View Profile
« on: May 17, 2011, 03:11:03 PM »

Hello there Smiley

As usual I have crazy proposal that potentially may result in more effective and clean template writing.
As long as I know, today in order to handle differently file types (lets say images diferently than music) I have to write something like this

Code:
[file.jpg=file.jpeg=file.gif=file.png=file.bmp= ...and other 1000 types of image...]
<tr> <td> handle images one way </td> </tr>

[file.mp3=file.m4a=file.aac=file.flac=file.mpc= ...and other 1000 types of audio...]
<tr> <td> handle audio files another way </td> </tr>

[file.avi=file.mkv=file.mp4=file.flv=file.mpg= ...and other 1000 types of video...]
<tr> <td> handle video files third way </td> </tr>

In my example it looks compact but is actually not.
1.  we indeed have thousands of file types for audio/video/pictures/other documents.
2. consider if type-specific section handles only small part of whole HTML code - file icon - but all other attributes are handled uniformly
Code:
[file=folder]
<tr><td><a href="%item-url%">

[+file.jpg=+file.gif....]
<img src="/images/picture.png">

[+file.avi=+file.mkv....]
<img src="/images/video.png">

[+file=+folder]
</td><td>... all item attributes</td>

[+file.jpg=+file.gif....]
<button onclick="preview('%item-url%')">Preview</button>

[+file.avi=+file.mkv....]
<button onclick="play_flash('%item-url%')">Play</button>

[+file=+folder]
</tr>

Nice feature, isn't? Now consider every section [file.xxx=..] indeed includes many types?

My proposal is as follows. Support for file section like this [file|mime: filter].
For example [file|mime: images/*] would match every images registered in HFS MIME-types list; [file|mime: image/jpeg] would match only JPEG images etc.
This format is just proposal. There are different variants, like [file(image/*)]. This has advantage that it can be used like this: [+file(images/*)=+file(video/*)]

Hope rejetto finds it useful.
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #1 on: May 24, 2011, 11:08:51 AM »

that's to not write file.jpg=file.gif=file.png=etc, correct?
i understand it's nicer, but we have so many important things in the to-do list that it will never see the light. Sorry
Logged
SamePaul
Experienced poster
***
Offline Offline

Posts: 70


View Profile
« Reply #2 on: May 24, 2011, 01:07:20 PM »

OK. There are more important stuff indeed   Roll Eyes
Good that you respond. I was starting to worry
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 14, 2012, 03:25:38 AM
anything