I had reduced my code down to try to simplify the problem. However, I forgot that my template uses a comparison which seems to be causing the problem. The TBS documentation says this about fields in the template: "If the value contains spaces, semicolons or quotes, then you can use single quotes as delimiters." I believe this is what is actually causing the problem. For example, if I have an array like this:
array("name" => '', "title" => "JOURNAL & PROCEEDINGS OF THE ASIATIC SOCIETY OF BENGAL");
|
then the & confuses my template due to the semicolon. The text terminates with "JOURNAL &" but also corrupts my file.
Here is what I have in my template:
[a.name;if [val] =’’; then [a.title];else ‘[a.name]’; block=tbs:row]
|
I've gone down the path of single-quoting the & as both '&' or &';' as the documentation suggests. The first results in the title being JOURNAL '&' PROCEEDINGS OF THE ASIATIC SOCIETY OF BENGAL, which is incorrect since it shouldn't have the quotes around the ampersand. The latter still causes corruption.
I need the comparison because if the name is empty, the title should come first and not leave a blank space. Is there a way to do this without the use of comparisons?