@nodeham said in A post showing a grid?:
@pitaj Yes, like a table is exactly what I need.
No kidding, it's that simple? Amazing.Thank you!
You can use this template:

Markdown automatically converts those codes into a table.
Is there a variable I could use to call {topic.content} but the first 140 char or so? That would look pretty neat if you do it right.
can you truncate?
var truncateStr = function (str, len) {
if (typeof str != 'string') return str;
len = isNumber(len) && len > 3 ? len : 140;
return str.length <= len ? str : str.substr(0, len - 3) + '...';
};
var isNumber = function ( nb ) {
return !isNaN( parseFloat ( nb ) ) && isFinite( nb );
};
The crappy part is you might accidentally truncate in the middle of HTML, or worst yet...:
140 chars:
this is my post with some styling included, because that's how I roll. Check it out, here is some <b>bolded text! See what happens when I k
... and then suddenly the rest of the posts are bolded
perhaps your snippet can disclude html tags. didn't we do something like this for the teaser text on the cat view? what exactly are you trying to do, maybe I can help
140 smells like twitter, I think @psychobunny is right, exclude html tags, or sanitize, then truncate.
Probably should truncate by words too, not chars.
Okay 255. Let's be unique here...