Hi everyone,
I’ve got multiple (image gallery) channel entries set up with to store multiple images (using Matrix). In my Javascript template, I want to query the entries to pull all of the image data and push each image into an array. From there, the array will be fed into my gallery rotator.
1. The site visitor will click a button to load a set of gallery images (which is one channel entry).
2. jQuery will pull the {entry_id} out of the button html.
3. The {entry_id} number will be stored in a javascript variable.
4. A EE channel:entries tag in the javascript will query the same channel, using the {entry_id} variable to know which entry to pull from.
5. Each image gets pushed into an array.
The part that is tripping me up is the EE channel:entries tag using the {entry_id} variable, since the ” entry_id=’ ’ ” part of the EE tag converts the variable to a string.
Is there an easy way to do this without getting into storing the numbers in PHP or is PHP the only way to pull that off?
here’s the code:
nav.click(function(e) {
var $target = $(e.target);
var entryId = $target.attr('rel');
{exp:channel:entries channel='gallery-couple' entry_id=' ' }
var galleryImages = [
//push images into array
];
{/exp:channel:entries}
});Thanks for the help!
-B