problem with link when a quote character is in Artist


My export file (HTML, based on Milka's work) has a problem when the Artist name has a quote in it (EX: John's Songs). I have tried using $replace, with no results. I'm not sure I understand the relationship between "id=" and "javascript show" and the actual display name, in the line that loops. The Artist name appears several times in the export code on that one line.

The problem is the Artist name won't expand and show the Albums if there is a quote mark in the name.

Also, sometimes it appears to be %artist% and other times %artist%. Why does the underscore sometimes appear at the front, and other times at the end?

Here is some of my code...:


<td class="row2" align="center" width="5%%">•</td>

<td id="id%artist%" class="row2" width="50%%"><b><a href="java script:show(''%artist%_'');">%artist%</a></b></td>

<td class="row2" align="right" width="22%%">$loop(%album%,1)$loopend() %_max_counter% Album(s)  </td>
<td class="row2" align="center" width="5%%"></td>
<td class="row2" align="center" width="18%%">%genre%</td>
<tr style="display:none;" id="show$replace(%album%,'',)">
	<td class="row3"  align="center"> </td>

   	<td class="row3">$loop(%_filename_ext%)             


<td class="row3" align="center"></td>
	<td class="row3" align="center"></td>
  	<td class="row3" align="center"></td>




Thanks for the help!!

%album% %_total_files% tracks %year% %genre%


You can't use quote char becase it's used for begin and end mark of id.

I will try to edit this piece of code but I don't have the whole code. :frowning:


Try doing something like $replace(%artist%,",").


I tried that, couldn't get it to work. It actually did change the visible description, but it still wouldn't link open. I think there is a problem between the id= and the href= part. %Artist% is used several times in the same line.

I may just change the tags; it's simpler. But not as clean a solution.



Fixed it! I wasn't using the $replace properly. I went back & studied some more, and finally solved it.

Then I discovered another weird problem. If there are two or more Albums with the exact same name, it wouldn't open them correctly. Turned out to be a problem in the href/id function (dupe IDs). So I added the artist name to the href of each album, and fixed that! :smiley:

I'm so proud of myself . . . :w00t:

Sebastian & Milka, thanks for pointing me in the right direction.