Removing IF Statement tags in HTML Export

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
User avatar
caseelse
Captain
Captain
Posts: 24
Joined: Mon Nov 10, 2008 3:04 am

Removing IF Statement tags in HTML Export

Post by caseelse »

Hiya,

I'm trying to include IF Statement tags in an HTML Export from DVDpedia. The idea is to add the German movie title to the HTML "title" attribute of an <img> tag but leave it out if the field with the German movie title (in my case "custom3") does not contain any data. In the HTML Export template I included the following:

Code: Select all

<img src="[key:coverImageURL]" title="[key:collectionID]: [key:title]<!--IFcustom3 ([key:custom3])ENDcustom3--> ([key:country] [key:theatrical])">
In Firefox 3.0.10, if custom3 does contain data, the result is as follows when you move the mouse pointer over an image:

Code: Select all

The Original Title (Der Deutsche Titel) (USA 1994)
However, if custom3 is empty, the result is as follows:

Code: Select all

The Original Title<!--IFcustom3 ()ENDcustom3--> (USA 1994)
Is there any way of getting rid of those tags completely if the field is empty so that the image tooltip displays as "The Original Title (USA 1994)"?

Thanks for your help and for this totally awesome product.
cheers
Holger
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Removing IF Statement tags in HTML Export

Post by Conor »

The tags are left as they when empty as HTML comments should be ignored by the browser, obviously this seems to not apply to Firefox and the title tag. The reason for leaving them in was speed during the export operation but removing them should not be a problem. Try out the beta and it should remove them for empty versions, and should make it to the next release unless there are any speed issues or unforeseen problems with removing them.
User avatar
caseelse
Captain
Captain
Posts: 24
Joined: Mon Nov 10, 2008 3:04 am

Re: Removing IF Statement tags in HTML Export

Post by caseelse »

That's great! The tags for the empty fields are removed now. Speed-wise it feels slightly slower than before, but I've got a bit over 500 movies so exporting the detail pages plus cover images takes a while anyway.

Anyway, thank you so much for this quick fix. You're the greatest :D
Post Reply