Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Very Popular

    Let's build a reviews database for Invision Community Pages

    Jimi Wikman

    As the number of databases grow here, it becomes annoying to add the fields for reviews in each of them. So, to fix that, I am going to build a new database for reviews that I can then connect to different articles or products as I see fit. This will give a central place for reviews that is flexible and easy to extend.

    So what are we going to build?

    image.png

    This is a basic design that we will start with, as I already have this design built. It comes with a headline, a summary,  a total review box, three headlines with ratings and a summary of how other people voted on the review. When writing the review, you will also have a long review text. This will not be a part of the review summary, however, but we will add a "See the full review" link to this design.

    For this to work, we will first set up the database and add the custom fields that we need. In total, we will have ten custom fields for the layout itself:

    • Review Theme (so we can set the color theme)
    • Review Headline
    • Review summary
    • Review Summary Rating
    • Review Category 1
    • Review Category 2
    • Review Category 3
    • Review Category Rating 1
    • Review Category Rating 2
    • Review Category Rating 3

    We will also need to connect the review to something, so there will be several custom fields for that. In my setup, I will attach the reviews to Articles, My Personal Blog, Products, Companies, Hosting, a generic one for the site and me and then I have two connections that I will need to build the databases for.

    In order for this to pass through properly, we will need to add a basic relationship template in my theme. I have written an article about that here, and I am working on another one in the Invision community Playbook.

    In each database item, we will be able to define the placement if we want to change it from the default, which will be at the bottom and we can also override the Review Theme if we want. This is so we can control the database items themselves.

    Things I have not tried yet....

    In the form, I want to try to limit the form so you only get one database relation instead of all options. Not only will it be a bit confusing to have multiple options, but it also opens up for other problems that I hope to avoid. The way I want to try to do that is to add conditions based on the selected category. This is since I plan to have the reviews database setup with one category for each database (so Product Reviews, Company Reviews and so on).

    I know I could do this with JavaScript, but I prefer to have this server side to prevent DOM manipulation from bad people ūüôā

     

    If things go as planned...

    This should not be a very difficult setup, and I will use the same basic setup I already have with the Playbook templates. It will take some time as I am still down with what I suspect is Covid, so my brain is very slow and my energy levels almost nonexistent.

    But we will get there soon enough as long as we move forward ūüôā

     

    Discuss the Guide

    Recommended Comments

    • Owner

    This is now in place, but I have two things that needs to be done: Change the output in basic relations so it shows the review correctly and add a function for "Featured Review", which will show up inside the content as opposed to in a separate tab.

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    • My Personal Blog

      About the Author

      Jimi Wikman is the owner of this site and this is his personal blog. Jimi is an experienced IT consultant that enjoy movies, TV series, working out and playing games on his PC.

      Opinions expressed are solely my own and do not express the views or opinions of my employer.

×
×
  • Create New...