Page 1 of 1

An entry index numb var available from the template?

Posted: Tue Jul 27, 2010 12:52 am
by Stosh
I have spent quit a bit of time searching, and have even tried "$entry.index" just to see if anything displayed.

I am working on a set of share/bookmark/tweet buttons, and have tripped over the twitter 140 character (SMS, of course) limit. I made my own small-urls by using truncate:19:"":true which was enough to assure the first five characters of the url (which include the index number) are handed to the mod_rewrite rules. Just tacked a new ".html" onto the end of it, and it worked fine.

It would be nice to simply hand in JUST the index number there (less kludgy). Trouble is, I can't find anything that tells me where to find the variable with just the index number in it. I'd guess it is one of the properties of $entry, but, well, I can't find the reference manual for it.

Thanks if you can help.

-djr

Re: An entry index numb var available from the template?

Posted: Tue Jul 27, 2010 12:04 pm
by garvinhicking
Hi!

{$entry.id} :-)

Regards,
Garvin

Re: An entry index numb var available from the template?

Posted: Wed Jul 28, 2010 12:04 am
by Stosh
Garvin

Ha! Why didn't I think of that. Thank you.

-djr

Re: An entry index numb var available from the template?

Posted: Wed Jul 28, 2010 8:55 pm
by Stosh
Also, for lurkers who may be setting up their own small-twitter urls:

You will need to include a trailing dash after the $entry.id number. (e.g., ".../42-.html" i.e., "...{$entry.id}-.html").

I didn't go back and look to see why the mod_rewrite rules require it, but it is easier just to add the extra dash-character than to try to re-write the rewrite rules with all the unintended consequences that may entail :P

-djr