Timeline Templates Formatting

In the document “Timeline Templates and Rendering” Accounts Dashboard | HubSpot, it is stated:

“If you are creating or updating the template through the API, you can use \n to render a line break.”

However, this doesn’t appear to work. How do I render a line break?

Hi @Renegade,

I think you’re right that that documentation needs an update. If you take a look at the “Defining Templates” section of the Timelines Overview documentation: Accounts Dashboard | HubSpot, there’s a note on there: “We accept two templates: the header template which should be just one line describing the event…”

In testing, I was able to submit the header template with a line break, which ends up showing up in the event type itself. But on the actual record timeline, it’s reduced to one line.

I’ll ask that we get this article updated: Accounts Dashboard | HubSpot. And I’ll see if we can add some validation into the API itself, since I think it makes sense to alert the developer about this, when we’re not actually allowing multiple lines for a header template in the record timeline.

As for the detail template, I’m not sure what’s actually intended here. Our documentation does state that the template is rendered through markup. And if you take a look at this cheat sheet for markdown: Markdown Cheatsheet · adam-p/markdown-here Wiki · GitHub, you’ll see that you can use a double space to create line breaks. So for example:

line one 
line two 
line three 
line four

So basically after “line one” I have two line spaces like so: "line one ". So again, I’m not totally sure what’s intended here, and I’ll need to see if the \n is working as intended. But hopefully this is helpful in the meantime. Let me know if it works for you?

- Leland

I’ve read the articles on markup, and absolutely nothing works for line breaks or even bullet lists. I find it extremely odd that this can be the case and no one has ever brought it up. So I suppose I’m doing something wrong. But this seems so straightforward that I don’t know how it’s possible to get it wrong.

And by the way, in your example above, why do you show “line one” and “line two” with two spaces after each, but already on separate lines? Shouldn’t it be:

"line one line two "

I finally got something to work. It seems that ONLY this works:

" \n"

(…this is two spaces AND the’ \n’ character.) Why? I don’t know. :wink:

Your solution was the only solution that worked.

1. Thank you!

2. HubSpot should doc that.

3. If possible, just make the more intuitive normal /n work instead of cryptic space space /n which I’d never guess in the world..

Hello @Renegade I was facing the same issue as you, however after reading the link Accounts Dashboard | HubSpot I’ve discovered that the timeline accepts the Markdown syntax. So in order to render line break, you can just use the " \r" (two spaces followed by the return character). :grinning_face: