Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-12-05 00:41:30

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

How to accept reviews (stars and comments)?

Does anyone recommend a specific approach to offering a reviews feature on a TXP site? I saw wlk_helpful but it seems oriented toward “Helpful? Yes | No” situations.

Thanks!

Offline

#2 2013-12-05 10:54:26

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: How to accept reviews (stars and comments)?

+1 for curiosity on this, I’m looking for the same functionality.

Offline

#3 2013-12-05 11:19:23

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: How to accept reviews (stars and comments)?

I’m working on a review site at the moment, but I’m using ExpressionEngine because it has very good built-in support for membership, plus an optional discussion forum module that integrates tightly with the membership features and other aspects of the CMS.

For the review functionality I’m using the Rating module from Solspace which adds some really useful features.

Are you thinking of reviews that include a 5-star (or similar) rating as part of the review?

Just thinking out loud about this, but one approach might be to investigate the possibility of extending the commenting feature in Textpattern to add a custom field to each comment to hold the rating value, storing a number between 1 and 5. There are plenty of ways then to display a star rating based on this number and also to use an Amazon-style clickable star rating feature (e.g. see Raty).

Not sure how easy it would be, or, indeed, if anyone has ever done it, but that’s where I would start looking.

Offline

#4 2013-12-05 11:58:51

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How to accept reviews (stars and comments)?

If you want to store ratings on your site, you would have to develop a new plugin for that. Textpattern does not have any functional rating plugins.

Offline

#5 2013-12-05 13:00:46

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: How to accept reviews (stars and comments)?

I would be very willing to contribute to a bounty if this is a viable plugin.

Edit: Having direct or indirect Rich Snippet (schema.org, essentially) support would be amazing.

Last edited by gaekwad (2013-12-05 13:02:18)

Offline

#6 2013-12-05 13:39:26

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How to accept reviews (stars and comments)?

In Textpattern model markup is fully customizable. E.g.

<txp:ratings results="1" wraptag="ul" break="li">
    <strong><txp:rating_option /></strong>: <txp:rating_count /> votes
</txp:ratings>

Or listing options:

<txp:ratings>
    <a href="<txp:rating_url />"><txp:rating_option /></a>
</txp:ratings>

Widgets suck donkey ass.

Offline

#7 2013-12-05 14:25:02

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: How to accept reviews (stars and comments)?

gaekwad wrote:

I would be very willing to contribute to a bounty if this is a viable plugin.

Edit: Having direct or indirect Rich Snippet (schema.org, essentially) support would be amazing.

The easiest way to incorporate schemas IMHO is to use custom fields for the individual pieces of content that make up the schema and then wrap those pieces of content in the appropriate schema tags in your template. (As I described in this post relating to the music events schema.)

I’m looking forward to the teased native unlimited custom fields with Textpattern 4.6, it should make creating a flexible content model a lot easier and make Textpattern much more flexible and adaptable going forward.

Needless to say, I’m making heavy use of the review schema in the site I’m working on.

Schemas need to be fully integrated into the content of a site and such the only way to implement them properly is by separating out your content into separate logical chunks that represent that different pieces of the schema that you want to use. Trying to retrofit schemas onto monolithic chunks of content is painful and destined to failure.

OT, but I’ve seen one example of a WordPress plugin that allows people to add certain schemas to a page, however, from various blog posts and reviews of it I’ve seen around the web, a lot of people are using it incorrectly by adding it to existing content rather than wrapping existing content with the correct schema tags. They then wonder what this “extra box of schema tags” is doing polluting the visual look of their site, so the common wisdom to solve this seems to be to put it in a div marked up with display: none;. Which results in Google ignoring the content of the box and making the added schema worthless.

Offline

#8 2013-12-05 15:35:45

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: How to accept reviews (stars and comments)?

springworks wrote:

The easiest way to incorporate schemas IMHO is to use custom fields for the individual pieces of content that make up the schema and then wrap those pieces of content in the appropriate schema tags in your template. (As I described in this post relating to the music events schema.)

This is exactly what I do right now. My ideal would be to have the values easily retrievable in some numerical text form so I squirt them into schema/meta things, as opposed to having just a star listing a la Amazon, et al.

Offline

#9 2013-12-05 17:14:06

etc
Developer
Registered: 2010-11-11
Posts: 5,393
Website GitHub

Re: How to accept reviews (stars and comments)?

As long as your ratings are only presentational, that’s very easy to do, appending a jQuery script at the end of the comment_form:

<script>
$(function() {
	$("#txpCommentInputForm").after('<p id="rate">Rate it: <input name="rate" type="radio" value="1" />1...<input name="rate" type="radio" value="5" />5</p>');
	$("#txpCommentSubmit").click(function() {
		$("#message").val($("#message").val()+'\n\nRating: '+$("#rate input:radio[name='rate']:checked").val())
	});
});
</script>

Offline

#10 2013-12-05 18:28:06

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 241
Website

Re: How to accept reviews (stars and comments)?

Here’s somewhat simple rating script which can be seen in action over here, although it’s a bit modified version in Lakitoimisto.info.

Last edited by kuopassa (2013-12-05 18:29:07)

Offline

#11 2013-12-05 18:35:20

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: How to accept reviews (stars and comments)?

Thanks everybody. Petri, I liked your idea of looking at a third-party script. Since I needed one that allows written reviews too, I searched around and found this: http://www.review-script.com/ (Is it just me or do these pay-for-script websites age faster than normal?) It’s not cheap, but I like that you can purchase a Facebook authentication add-on.

Offline

#12 2013-12-05 20:20:39

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: How to accept reviews (stars and comments)?

etc wrote:

As long as your ratings are only presentational […]

Without wishing to thread-hijack, here’s how a vote mechanism might work in my mind:

  • one opportunity to vote, either based on cookie, IP or some other identifier – clearly not 100% infallible, but good enough
  • scores are tallied and stored in the database; extracting a percentage approval rating (59% liked this), an absolute score (86 said yes, 31 said no) or something similar would then be possible using etc_query (see what I did there?)

Offline

Board footer

Powered by FluxBB