How can I print the first n characters of a smarty variable, e.g. the first 30 characters of {$var}?
You should use truncate modifier:
{$var|truncate:30}
More information here.