Skip to content

Instantly share code, notes, and snippets.

@phillipadsmith
Created May 7, 2009 16:11
Show Gist options
  • Save phillipadsmith/108186 to your computer and use it in GitHub Desktop.
Save phillipadsmith/108186 to your computer and use it in GitHub Desktop.
<%init>
# First, let's check for an associated media asset, which we need
my $media = $element->get_related_media or $burner->throw_error(
'Hey, you forgot to associate a media document! ',
'Please relate or upload an image for this story. ',
'You can upload JPEGs, GIFs, or PNGs.'
);
# Now let's re-size it for the thumbnail
my $image = $element->get_related_media;
my $thumb = $m->comp('/util/thumbnail.mc', image => $image);
# And publish it immediately
$burner->publish_another($_) for $thumb;
my $elem = $story->get_element;
my $rel_media = $elem->get_related_media;
my $med_uri = $rel_media->get_uri;
my $media_id = $rel_media->get_id;
</%init>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment