ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

dynamic image loading with jquery and matrix

October 19, 2012 1:48pm

Subscribe [2]
  • #1 / Oct 19, 2012 1:48pm

    bkodit

    1 posts

    Hello,

    I’m trying to figure out how to use jquery to dynamically load slides in a matrix field each time a button is clicked.

    I have this matrix field that can have any number of images in it. there are a small but variable number of entries (about 5), each with different slideshow content in their matrix field.

    One option is that I could create a separate template that just outputs the matrix field, and then selectively pull in <li>‘s by id with .load

    $(’#result’).load(‘ajax/test.html #container’);

    . but this template will only be good for the most recent entry, and will give the others the wrong slides.

    The other way I thought to do it is to use jquery to dynamically update the matrix parameters. but, I can’t seem to write EE tags in js which are then parsed: 

    $(‘ul#slides’).html(”{project_images limit='2' offset='0'}<li id=‘slide{row_count}’>{proj_image}</li>{/project_images}”);

    this just renders static html.

    I feel like maybe there is some way of doing this, maybe using the (javascript template?) that I don’t know about.

    My best clue is this brief thread from brandon kelly: https://getsatisfaction.com/pixelandtonic/topics/method_to_limit_matrix_results_for_slideshow

    But I’m not sure what to do next…

    Does anyone have thoughts for how to accomplish this?

    Thanks!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases