Hi Kev1n,
I wanted to display some real photos of product inside the HTML box (so only photos for choosen product).
Photos are stored on server in one folder.
Names of photos and assignements to products are stored in mySQL table.
So depanding on the product I wanted to generate list of photos in mySQL and later to transfer it to nuBuilder JS to display them using directly path to photos.
So the biggest difficulty I had it was - how to tranfer mySQL data to JS or HTML inside nuBuilder.
But anyway finally I implemented following solutions which works very well now.
I use Object/Display field (name: pic_list) where the following query is placed (and read data from mySql)
Code: Select all
select fot_picture from fotos_all where fot_part_nr='#par_sample_id_number#'
Additional issue was that in such field only the first row is placed. So in Mysql I am generating view with long rows and in every row I have a list of all photos attached to one product.
later in JS I read the data from the display field and generate list of photos for HTML field
Code: Select all
var lista = $('#pic_list').val();
var temp= "arr =['"+lista+"']";
var arr = eval(temp);
var holder = document.getElementById("holder");
for(var i=0; i < arr.length; i++)
holder.innerHTML += "<img src='./uploads/"+arr[i]+"' style='width:300px;'>";
and finally in HTML field just following short code is placed which displays all selected photos one after the other: