Inserting url into html template.

Not so much a webix question I think.

I’m trying to insert an image url into a html template,

//graphics/04/12304.jpg
var image_url = "graphics/" + obj.image_id.substr(obj.img_id.length-2)+ "/" + obj.img_id + ".jpg";

var tv_template = "<div><center><IMG SRC=image_url ALT=\"some text\" width=200 height=128></center><h3><center>\"#image_name#\"</center></h3>"

Any ideas, suggestions much appreciated.

Gee

Not so much a webix question I think.

I’m trying to insert an image url into a html template,

// graphics/04/12304.jpg
var image_url = “graphics/” + obj.image_id.substr(obj.img_id.length-2)+ “/” + obj.img_id + “.jpg”;

var tv_template = “div-center–IMG SRC=image_url ALT=“some text” width=200 height=128–/center–h3–center-”#episode_name#"/centerh3"

Removed html tags so its actually readable.

Why not use a bit different notation?

http://webix.com/snippet/ec6ac830

Thanks for the suggestion. Had actually tried something like this as an attempt to get to were I wanted to be.

As you can see adding this to the html results in a broken image.

http://webix.com/snippet/ba99eb5f

What I’m trying to do is build the image directory from the filename, ie
take the last two digits of filename and thats the directory in which the file is found.
ie

http://image/[last two digits of year]/##year##.jpg.

= http://image/94/1994.jpg where ##year## = 1994.

Still tying to get something working.

Regards
Gee

There’s a typo in your html: space is missed between image_url and alt attribute:

http://webix.com/snippet/527f0b62