How to create a trending posts section?

Hi guys,

I have created a trending section on the home page which shows ‘recommended’ posts.

Looks like this:

But when I preview, nothing shows. Has anyone created here trending posts section? Please tell me how to go about this?

1 Like

So a recommended post is one that you’ve tagged as such? Can you confirm that your data source contains a few recommended posts?

I see that there are two types there: Reco’ed Book and Reco’ed Link…

So a user can mark a post as recommended.

When that is done and if the lits (likes version basically) more than 1 then it will show in the trending section ( 1 because the platform is new)

I do have recommended reads by test users. but it doesn’t show.

So you can either recommend a book or an article (link). The databases for both is different, hence different constraints.

Ok, this is interesting. So books and articles are different databases?
So your DB structure is:

  • Books (with likes)
  • Links (with likes)
  • Posts ?

Is this correct?

This is the DB:

Can you show me the Post Database too, please?
Are you nesting a list of Books and a list of Links inside the Post database?

It seems your repeating group is pulling data from Post, but you want it to show data from Book, or from Link

Additionally, your constraints and data source are very weird considering what you want is Book —> Recommended = yes

This is the DB for post:

Here, the ‘tag a book’ and ‘tag a link’ basically saves the text input (name of book and link URL). Then here too I have given option for recommended ‘yes/no’ for both link and book.

So this seems overly complicated.
Can you explain what’s your thinking behind this setup?

Are you hoping to pull the “Book” data entry by searching it by name from this “Tag a book” field?
Why do you have “Recoed” book again here?

(I’m taking you through the steps so you can learn for the future)

So I have created a different datatype ‘book’ and ‘link’ for creating an overall database of links and books that people are sharing.

Yes, ‘tag a book’ saves the name of the book. So this name acts as an input for ‘google books API’ to generate the complete information about that book. The other ‘book’ datatype saves this book title so as to create a complete database separately for books.

I am not using ‘book’ type database to retrieve anything. Things are retrieved from ‘post’ itself.

This topic was automatically closed after 70 days. New replies are no longer allowed.