I'm building a small app within meteor, using the yogiben favourites package to allow users to favourite select items in a collection.

Currently the below code only shows the ID of the favourite/post, rather than the corresponding title.

How can I show the title?

  <template name="favoritesSidebar">
  <div class="template-favorites-sidebar">
    {{#if myFavorites.count}}
    <div class="panel panel-default">
        <div class="panel-heading">
                <h3 class="panel-title">{{_ "favorites"}}</h3>
        </div>
        <div class="panel-body">
            <ul>
            {{#each myFavorites collection="Posts"}}
                <li>
                    <a>{{_id}}</a>
                </li>
                <li>
                    <a>{{_title}}</a>
                </li>
                <li>
                    <a>{{Post._title}}</a>
                </li>
            {{/each}}
            </ul>
        </div>
    </div>
    {{/if}}
 </div>
 </template>

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.