Krang::ElementClass::MediaLink - media linking element class


   $class = pkg('ElementClass::MediaLink')->new(name           => "photo",
                                                allow_upload   => 1,
                                                show_thumbnail => 1);


Provides an element to link to media. A reference to the media object is returned from data() for elements of this class.


All the normal Krang::ElementClass attributes are available, plus:

In addition to the normal interfaces, Krang::ElementClass::MediaLink also supports a ``find'' parameter. This parameter allows you to specify a ``hard filter'' which is used to limit the scope of the universe of stories from which the user may select. For example:

  # Only images
  my $c = Krang::ElementClass::MediaLink->new(
                name => 'associated_image',
                find => { media_type_id => 1 }
  # Only images about cats
  my $c = Krang::ElementClass::MediaLink->new(
                name => 'associated_image',
                find => { media_type_id => 1,
                          filename_like => '%cats%' }

Any find parameters which are permitted by Krang::Media may be used by Krang::ElementClass::MediaLink's ``find'' parameter.