Creating Pages and Display with Meteor


#1

I’m using Meteor to create a social-media type website, where information is extracted from a textarea and is then displayed using a spacebar

e.g: {{>posts}}.
I know how to do this, but I want to be more specific, where this post draws from two textareas as:

  • One being the title and

  • Another one being the actual content, as well as it showing the Author’s name.

Again I know the run-down on that but it is more about the displaying, where on the main page I want the title, date and author in format and when you click on this spacebar:

e.g: {{>small}}
it opens as the content:

e.g: {{>big}}
but I’m not sure how I should achieve this linking between the two and then the display of the actual content not just the title.

Any help would be appreciated!

Thanks.


#2

So you want like an accordion effect? Something along the lines of: http://getbootstrap.com/javascript/#collapse-example-accordion


#3

Wow, that looks great,
but how do I connect the two spacebars, if there can be multiple instances of posts?


#4

I find your terminology confusing. I assume you mean {{>small}} and {{>big}} are ‘spacebars’?
I would refer to these as templates.

Personally, I would keep it in one template, and just use a {{#each in}} to build the accordion, like {{#each post in posts}} and let the accordion hide the content. If you think you’ll reuse the content of the accordion, perhaps consider a reusable component.