DoctorWatson
Posts: 5
Joined: Sat Jan 30, 2016 9:40 am

Include external text lines

Does Highslide include a way to read text lines from an external .txt file, load them into variables and display them where they are needed?
Let me explain : I'm trying to build a web page where the same number of new images will be uploaded and displayed on a daily basis. I've already figured out how to do this.
This is code generated by the editor but slightly changed:

<a href="highslide/images/large/01.jpg" class="highslide"
title=""
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/large/01.jpg" alt=""
title="Description(1)" width="180" height="120" />
</a>

Let's say there are 3 images (01.jpg, 02.jpg, 03.jpg). So every day a new 01.jpg (etc..) will be uploaded. You don't need the Thumbs, just use the original images and resize to create them instead of using 'thumbs'.

The problem is the 'title' - where I put "Description(1)". Because that description will also change every day for each image. Using the editor's generated code, I would have to edit the page every day, search for the Descriptions and change them. Whereas uploading a simple text file could take care of things. I used to program in Basic and never had problems using variables, but I can't find how to do it in web pages.
Can this be achieved ?
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Include external text lines

DoctorWatson wrote:Does Highslide include a way to read text lines from an external .txt file, load them into variables and display them where they are needed?
The short answer is "no." It can pull the caption from the alt or title attribute, but that doesn't really help you - you'd still have to do some manual editing.

You might want to consider using another application to generate your pages, one that uses Highslide JS "under the bonnet," so to speak, but that would simplify the whole process of changing images, changing caption text, and so on. I write several "skins" for jAlbum. jAlbum is an application that generates photo album web pages. The skins aren't just simple color/style variations, but are almost like separate apps themselves. Some produce basic HTML/CSS pages, some of the old ones crank out Flash pages, and two of mine use Highslide JS to display the images.

Using jAlbum and my Matrix skin, there would be no manual editing of raw files at all - you could swap out the images, enter your new captions directly in the application, hit the "make album" button, and upload the result.

Some demo's, which barely scratch the surface of what can be done: http://jgromit.com/matrix/
DoctorWatson
Posts: 5
Joined: Sat Jan 30, 2016 9:40 am

Re: Include external text lines

Well, I will definitely have a close look at jgromit, but I suppose using one of the skins still would require to rebuild and upload the whole album each day. The main reason why I'm looking for a way to just having to upload the 3 images and a simple text file with the captions is, that the daily updates will most of the time be done by a person who is not much at home with using programs.
I am already on the lookout for some small applet and / or some JS or PHP code that can achieve what I need. Must be something out there. I hope .....
MisterNeutron
Posts: 440
Joined: Sun Aug 18, 2013 11:20 am

Re: Include external text lines

jAlbum includes a smart uploader, so the only thing that would have to be uploaded each day would be the new images and the newly-revised HTML page(s). Nothing complicated at all. In fact, easier than fiddling around with separate text files. The person doing the updating would launch jAlbum, open the saved album project, delete the old images, add the new ones, put a caption on each one, click "make album" (it takes only seconds), and click "upload." Done.

jAlbum is, however, not free (my skins are free). A license has to be purchased.

BTW, if you start introducing PHP routines to alter your website content, you're inviting hackers (that's the Achilles Heel of CMS's).
DoctorWatson
Posts: 5
Joined: Sat Jan 30, 2016 9:40 am

Re: Include external text lines

As I said, I'll bear jAlbum (and jgromit) in mind, but I'm going to try to find out if what I have in mind - perhaps using an applet or script - can be done in the first place. Maybe trying to write something myself. Only, my programming skills have turned a bit rusty over the last few years ... :(
Anyway, if I would be using jAlbum and any of your skins, I will let you know.

Return to “Highslide JS Usage”