Wednesday, September 8, 2010

Concatenating text in blogger data tags

I was messing around with my blogger template, testing the best way to integrate a facebook Like button into posts (this due to numerous demands to see how its done properly and not in a side bar).

One of the methods I tested required me to generate different ids for different posts and the most logical way to do so would be to use to post id somehow. I searched the reference on blogger support but couldn't find any example, so I looked inside some templates and I found an example. So in the template we type this:
<span expr:id='&quot;myId&quot; + data:post.id'></span>
Please note that I have to use encoded quotes to surround the text and concatenate using the plus sign. This html will be rendered as a result by blogger engine:
<span id='myId8712387612387612'></span>

1 comment:

  1. Thanks, I'm working on a template for the first time right now, and I have to say, as far as beginners are concerned, the documentation is really lacking. At least it was for me anyway.

    ReplyDelete