Giorgi625 VIP
Total posts: 655
25 Jan 2017 17:10

I tried to create reviews system on my site via Type as comment solution but as I see I am not able to create powerffull reviews system in this way.

This feature is key for business direcotry, product catalog or some other kind of sites. So lets discuss this here. I will write down my thoughts how it is better to create this feature using cobalt.

I am working on a Movie database site. and fist just added reviews using type as comment solution and enabled multiple rating solution and added only textarea field to reviews type. So I have fiedl for reviews text and multiple criteria ratings. I disabled title because normally there is no need to create title for reviews, most needed feature is to get title from movie to which you leave review but as I know it is not possible in cobalt by default.

So my plan is that I create custom section and type for reveiws(I think it is enought to create just type for movie section for some situations, but in my case it is not enough).

So I have MOVIE Section and Type and REVIEWS Section and Type. I connect them via relation fields so that each review record can be assigned to only one parent. and submitting reviews will be available only in Movie record view, as I know relation field allows to display submit button in its template.

This relation field also is good when you need to display reviews in a module Cobalt records. In type as comment solution you would get only review text and ratings but how could you find out for which movie is that review? so In this case you can display via relation field movie title and poster with review text and rating. Also this solution allows us to have independent menu item with reviews list it is here Click here to link...

I hope I gave to some of you good idea for your project, aslo if you know how it can be improved more, please share your thoughts.

Last Modified: 24 Apr 2017


Sergey
Total posts: 13,748
01 Feb 2017 12:14

I get what you mean. The only problrm with relate fields is that it does not calculate total rating of the movie. So the best way is to use Comemnts.

Giorgi625 most needed feature is to get title from movie to which you leave review but as I know it is not possible in cobalt by default.\

YOu can do it in custoom form template.


Giorgi625 VIP
Total posts: 655
01 Feb 2017 18:21

Sergey I get what you mean. The only problrm with relate fields is that it does not calculate total rating of the movie. So the best way is to use Comemnts.

Giorgi625 most needed feature is to get title from movie to which you leave review but as I know it is not possible in cobalt by default.\

YOu can do it in custoom form template.

If counting total rating is only problem, for me this is not problem because |I use both Record ratings and Record rating is which must be calcualted but each reviews rating is separate and must not be calculated with other users ratings.


Giorgi625 VIP
Total posts: 655
01 Feb 2017 18:50

I have one question: Can user rate record while he is submiting it?


Sergey
Total posts: 13,748
02 Feb 2017 13:16

Giorgi625 I have one question: Can user rate record while he is submiting it?

Yes. this is what it is for. You set rating only for authors. Then only author can set rating. Then it is also will be available only during edit. And it will update total rating of parent article.

It is not only matter of total calculation. You can do that with Rating API. But if it updates parent, you can order by rating with is crucial in my opinion.


Giorgi625 VIP
Total posts: 655
18 Apr 2017 18:05

So I created reviews in a separate section and connected it to movies via relation field. But I have now some questions: This is screenshot of Reviews relation field in Movie Record full view.

http://i.imgur.com/JOD23ul.jpg

So there is file for Movie full view located in /components/com_cobalt/views/record/tmpl/"custom-template-file-for-movie-full-view" where is called relation field via this code:

<div class="movie-review">
    <?php if(isset($item->fields_by_id[369])): ?>    
        <div class="movie-review-label" id="reviews">ფილმის განხილვები</div>    
        <?php echo $item->fields_by_id[369]->result; ?>        
    <?php endif; ?> 
</div>

part of image in green box is second div(with class movie-review-label) from the code above, then field content (image part in red box) is displayed using php file located here: /components/com_cobalt/views/records/tmpl/"custom-template-file-for-review-list-view"

and then last little purple box which is ADD NEW button is called from this file: /components/com_cobalt/fields/child/tmpl/output/default.php file.

Am I able to show this button in right end of blue background on top of image?


Second question: User who adds review is able to change rating for each criteria even in movie full view, is it possible to allow user to rate only on submission form?


Sergey
Total posts: 13,748
24 Apr 2017 14:11

I think yes. set postion to relative for .movie-review and then position to absolute to button and position it to top right.

On your custom CSS.

Powered by Cobalt