Jump to content
UBot Underground

UBot html Template Engine


Recommended Posts

I'm reworking an existing bot and am trying to create an html templating engine. For the most part I think I've got a way to handle it with the exception of images. The issue with the images is that there are 4 potential image sizes that may be needed in different templates, and the number of available images will vary per record. Here's a simple example of what I mean:

 

The first image may be 350px in the template, but the remaining ones would need to be thumbnails at 75px. Since the number of images in each record varies, I can't simly use <img src="[img1] width="350"><br><img src="[img2] width="75"> ><img src="[img3] width="75"> ><img src="[img4] width="75"> ><img src="[img5] width="75"> because if there are only 3 images in the record I'll end up with broken images in the html.

 

I'm thinking that I use something like [img1_350] in the html and have that be replaced with the actual code image code and of <img src=[img1] width="350"> if the proper field in the record contains .jpg.

 

I think this will work, but I'm not in love with it so I'm open to any ideas. Any help is appreciated.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...