[Catalyst] display multiple png's simultaneously

"Jürgen Hensch" dschei-eidsch at gmx.de
Fri Jan 1 20:30:15 GMT 2010


Hi,

I am developing a small "media bookshelf" where I want to display in a matrix-like layout - among other informations - covers in png format (which are saved in a BLOB in my Mysql-DB). I have something like [1] in my mind. The problem I have now is, that only ONE cover is displayed at a time. The relevant code looks like this:

matrix.tt2:
-----------

<div class="table">
    <div class="tr">
[% FOREACH m IN medien %]
 [% IF ! (loop.count mod 4) %]
    </div>
    <div class="tr">
 [% END %]
        <div class="td">
            <div class="table">
                <div class="tr">
                    <div class="td"><object type="[% m.mime %]" data="[% c.uri_for(c.controller.action_for('cover'), [m.id]) %]" width="236" height="300"></object></div>
                </div>
                <div class="tr">
                    <div class="td">[% m.titel %]</div>
                </div>
                <div class="tr">
                    <div class="td">[% m.typ %]</div>
                </div>
            </div>
        </div>
[% END %]
    </div>
</div>

Medien.pm:
----------

sub cover :Chained('object') :PathPart('cover') :Args(0) {
    my ($self, $c) = @_;

    my $medium = $c->stash->{object};
    $c->response->header('Content-Type' => $medium->mime . "; charset=\"ISO-8859-1\"");
    $c->response->write($medium->cover);
}

I think I now where the problem is, but I do not know how I can fix it properly: The cover action in my Medien controller works with $c->response and therefor creates a new response for each object-tag in my tt2. So only the "last" cover is displayed.

Can anybody help me on how I get all covers displayed simultaneously?

Thanks

Jürgen

[1] http://forum.computerbild.de/attachments/benutzer-tutorials/musikverwaltung-tipps-tricks-problemloesungen-itunes-9073d1232463324-bild6.jpg
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the Catalyst mailing list