First, note that it matters whether the data tag e.g.
<data:post.id/> is PART OF an HTML tag, inside the angle brackets (like <a
href="templatetag">), i.e. whether it's part of an attribute's value - or
whether it's outside of the HTML tag's angle brackets.
If it's not inside the HTML tag (i.e. between the angle
brackets, the <> of the opening tag), you can just use the data tag as is - see
further example below.
If it is inside an HTML tag, forming part of the value of
an attribute like href (meaning it's included in the "stuff" part of
href="stuff"), then you have to rewrite the tag, or rather any bit inside the
tag that says something="somethingelse including template tag" (e.g.
href="<$BlogItemURL$>").
Example for adding to Delicious
<a
href="http://del.icio.us/post?url=<$BlogItemPermalinkURL$>
&title=<$BlogItemTitle$>"
target="_blank">Del.icio.us</a>
becomes
<a expr:href='"http://del.icio.us/post?url=" +
data:post.url + "&title=" + data:post.title' target='_blank'>Add to
Del.icio.us</a>
a howto, and trust me it's a lot simpler to do than to
explain!
1. Change href= to expr:href= (the added bit is in
bold black).
2. If it originally read href='stuff' using single quotes,
that's fine till the next step. But if it's surrounded by double quotes, e.g.
href="stuff", change those to single quotes i.e. href='stuff'. Marked bold red
in the example above too. Change any double quotes you see inside 'stuff' to
single quotes too. (Note: it might say href="stuff" target="somethingelse". You
can ignore the target="somethingelse" bit, except to change the double quotes to
single quotes (and any single quotes within the "somethingelse" to double
quotes, confusing I know!). We're mainly concerned just with the stuff within
the first set of quotes.)
3. You now have to look at what's inside the single quotes
and separate out the old Blogger template tags. It's easiest to add a space
before or after each old template tag as appropriate, so that you have separate
blocks inside the single quotes. So
<a expr:href='http://del.icio.us/post?url=
<$BlogItemPermalinkURL$> &title=<$BlogItemTitle$>'
target='_blank'>Del.icio.us</a>
(don't put any spaces between the template tag and either
the starting or the ending single quote, though).
4. Now make sure each block inside the single quotes which
is NOT a template tag has double quotes surrounding it, by inserting double
quotes in the right places. Marked bold purple below - don't forget the one just
after the opening single quote. So now it's:
<a expr:href='"http://del.icio.us/post?url="
<$BlogItemPermalinkURL$> "&title=" <$BlogItemTitle$>'
target='_blank'>Del.icio.us</a>
5. Finally, change the old template tags to their
equivalent data tags, but WITHOUT any angle brackets round them,
and with + signs between them and the other blocks in the href. So, if, in the
bit surrounded by single quotes, the data tag is at the start, add a + sign
after it; if in the middle with other blocks, add a + sign before and after it;
and if at the end just before the closing single quote, just add a + sign before
the data tag (it's much easier to see/follow than explain!). Be careful not to
accidentally delete the existing single quotes, and there should be no spaces
between the single quotes and what they surround. It then becomes (in bold
orange):
<a expr:href='"http://del.icio.us/post?url="
+ data:post.url + "&title="
+ data:post.title'
target='_blank'>Del.icio.us</a>
(note there's no space between the ending data:post.title
and the closing single quote ').
6. Rinse and repeat (i.e., do that again for all the other
attributes in the HTML tag whose value includes a template tag, such as
somethingelse="morestuff". If there's no template tag inside the morestuff you
don't have to do anything to the morestuff except change the double quotes to
single quotes and vice versa. As we did with target='_blank'.)
(Note: yes maybe you can swap the double and single quotes
and get it to work, but as New Blogger uses them in the order/way I've stated
above, best to follow that.)