[Templates] [RFC] Template::Plugin::MP3

Andy Wardley abw@andywardley.com
Wed, 6 Nov 2002 13:56:54 +0000


On Wed, Nov 06, 2002 at 01:08:35PM +0000, Mark Fowler wrote:
>   Can I pass it Template::Plugin::File objects?

Hmm, no, but perhaps you should be able to.  I also wondered if
an image should be a subclass of a File?

>   Is there a method that allows me to get the original filename back?

Yes.  I suppose this is a good time to explain what the name/file/root
elements are.

I was thinking that you should be able to provide a name for the image 
and optionally also, a root directory against which it can be found.

The reason you might want to do this is in generating HTML tags.  If
your web server image directory is /home/www/images and the relative
image is company/logo.gif then you would specify:

  [% USE image name='company/logo.gif' root='/home/www/images' %]

Then the plugin looks for the image /home/www/images/company/logo.gif
to stat, but uses the short name company/logo.gif when generating an
HTML tag.

So

   [% image.name %]   # company/logo.gif
   [% image.root %]   # /home/www/images
   [% image.file %]   # /home/www/images/company/logo.gif

In the simple case when you're just looking for images relative to 
the current working directory, you can just specify the file name.

   [% USE image name='company/logo.gif' %]
   [% USE image 'company/logo.gif' %]

   [% image.name %]   # company/logo.gif
   [% image.root %]   # 
   [% image.file %]   # company/logo.gif

Does that make good sense?

>   How exactly should people be organising non core plugins for CPAN 
>   upload?  One at a time, or in collections?

Erm, dunno.  In the case of Image, I think it's generic and generally
useful enough to go into the core.  And I'm happy to consider any 
other that people want to put forward.

As for non-core plugins, I guess the best thing to do is discuss them
here, try and get everything working together as nicely as possible,
upload to CPAN, promote world peace, and live happily ever after.

:-)

Any suggestions welcome, of course.

>   Does this have a VIEW hook like Template::Plugin::File does?

Erm, no, but it probably should do.

>   Who invented liquid soap and why?

William Shepphard first patented liquid soap on August 22, 1865. 
The first modern liquid soap was introduced in 1980 by Minnetonka 
Corporation. Minnetonka cornered the liquid soap market by buying 
up the entire supply of the plastic pumps needed for the liquid soap 
dispensers. The Colgate Company acquired the liquid soap business 
from Minnetonka and renamed the product Softsoap in 1987.

Quoted from http://inventors.about.com/library/inventors/blsoap.htm 
Found by Google

A