Sharing Posts from Custom page

#1

I am running Ghost v2.0 in my local machine.

I have a custom page called news.hbs where I have listed the posts using collections in routes.yaml as follows,

collections:
  /news/:
    permalink: /news/{slug}/
    template: news
    filter: tag:-[slideshow]

From here I have to share posts to twitter.

<a class="floating-header-share-tw" title="Share to Twitter" href="https://twitter.com/share?text={{encode title}}&amp;url={{url absolute="true"}}" onclick="window.open(this.href, 'share-twitter', 'width=550,height=235');return false;">
            {{> "icons/twitter"}}
        </a>

But the result is as follows,

image

I need the post url and the post title as follows,

Getting Started!!! http://localhost:2368/news/welcome/

but it is getting

[object Object] http://localhost:2368/news/

This is working fine in the post detailed page (post.hbs) but I want to integrate this in the post listing page (news.hbs).

closed #2

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.