Log in Sign up

How to display post title on home / entries page?

I was able to get the title to display on the entry itself by adding this line to the top of the entry.html template:

<h1>{(entry.title}}</h1>

However, on the home page where all entries are shown, there's no titles, which makes it hard to tell one post from another.

How can I add the titles to the entries page too?


5 days ago, 5 replies   developers   Edit question

entry.html for single post template. you should also edit the entries.html for your homepage/index template.

Answered 13 days ago · Edit answer

Thanks, I looked at the entries.html and tried entering the {(entry.title}} section in a few different places and it didnt work.

Can you suggest where I should put it please?

Thanks

Answered 11 days ago · Edit answer

{{entry.title}} won't work on the homepage since that property isn't exposed to the homepage (entries.html), even though it is exposed to the individual entry pages (entry.html)

Instead, in entries.html inside the {{#entries}}...{{/entries}} block, insert {{title}}, e.g.

{{#entries}}
  <h1>{{title}}</h1>
  {{{body}}}
 <p>Posted on {{date}}</p>
{{/entries}}

Does that help? Please let me know if you have any questions about this or anything else

Answered 8 days ago · Edit answer

Thanks, that worked!

Where can I see which properties are available to which pages?

Answered 7 days ago · Edit answer

Append json=true to the URL of any page on your site to see all the properties and their structure. I recommend using browser extension if you are not using a browser which formats JSON nicely, e.g. JSON viewer

Answered 5 days ago · Edit answer