Remember that if it's not inside the HTML tag, you can just
use the data tag as is? Here's an illustration, for Haloscan trackback code:
href="javascript:HaloScanTB('<$BlogItemNumber$>');" target="_self"><script
type="text/javascript">postCountTB('<$BlogItemNumber$>'); </script></a>
now becomes
<a expr:href='"javascript:HaloScanTB("+ "\"" + data:post.id
+ "\"" + ");"' target='_self'><script type="text/javascript">postCountTB('<data:post.id/>');
</script></a>
If you want to work through that further example to try it
out, using the steps explained above, you should end up with the same thing too
- with a couple of twists I'll now explain.
links to your posts e.g. on BlogPulse - I'll leave it to you to try that, and
other code you might want to try to convert.Finally, note also that when you separate out the blocks
that aren't template tags and surround them in double quotes, that really does
mean you should separate out literally everything, even little snippets. Like
the close bracket and semicolon in ");" above (and, of course, the green single
quotes that got converted to double quotes and then escaped).Here's a further twist. I included that example to point
out something else you may need to do. It's bad enough fiddling with single and
double quotes, but what if the code you are converting, which was originally
inside the double quotes (i.e. inside the "stuff" bit of href="stuff"), itself
contains quotes? Like the single quote ' in the Haloscan example above, which is
bold green in the old Blogger version. Well, remember you have to first change
that to double quotes ". Then, you have to do what programmers call "escape" it.
Which in simple terms means that you separate that double quote " from the other
stuff using spaces (like when we were splitting out the old template tags), then
you change it to "\"" - note the backslash and extra double quotes around it -
and again you have to insert + symbols as necessary to separate those quotes
from the other blocks inside the overall single quotes. I'm running out of
colours so the whole of that lot is bold green again in the final version.You will note that there's a <data:post.id/> with angle
brackets around it (in the context of postCountTB('<data:post.id/>');). That's
because it's inside a Javascript script as required by the Haloscan code, but
that script is not actually inside an HTML tag within the value of an attribute
(i.e. between the <> angle brackets of the a tag), so that's fine - and in fact,
in a new Blogger template, if you use a data tag outside of an HTML tag,
generally you will have to use the angle brackets or it won't work.