Posting outside comments to a Sparkle website

I am an experienced Sparkle user. I am about to build a new website with a store and want to find a way to post outside reviews of the products sold. Any ideas how to do this?

There are a number of options you can use for this. One of the simplest options is to use a third-party service such as Disqus. Alternatively, if you don’t want data-mining issues associated with third-party sites, you could install a comment script on your own server. Whichever option you choose, implementing it in Sparkle is relatively simple. You essentially paste a piece of code into an embed object in Sparkle and place it wherever you want your comment section to appear (usually directly under product or service information). Each product or service will have its own piece of code that relates to the comment thread for each product/service.

In choosing an option, you must ensure that you have a moderation option that allows you approve comments before they appear in your website. A good self-hosted solution would be the one from PHP Jabbers.

I was just having a look at the Sitejabbers script earlier today. But I got worried when I saw that you have to insert script in the header of each page you place the comments.


Is there any way around this?

There isn’t a way around this because the script is a PHP script and it relies on this piece of code to enable it to interact with your page. If it isn’t there, the comments won’t show and people will not be able to add comments.

The addition of a small code snippet like this isn’t a great problem or unusual - it’s quite common, for example, in sites where you have a members area of protected pages. There has to be a piece of PHP at the very top of your protected pages to prevent unauthorised access to the pages.

There are two things that have to be done with Sparkle pages. Firstly, the page extension has to be changed to .php and secondly, you have to add that code at the very top of the page (before the doctype declaration)

The easiest way to deal with this is to create your site as normal. The comment code can be inserted via a code widget in your page. Change the page extension to .php using the custom file name option. Publish your site to disk.

Before uploading, open your PHP pages in a code editor or plain text editor and add the code to the very top of the page, and the code at the very bottom. Save the page back and then upload to your server.

In many web development apps, there are usually options for pasting code in various places in a page - commonly, before doctype, head, or body. Because Sparkle is aimed at providing a fully self-contained environment for non-coders, it doesn’t yet have these types of developer option (maybe in a future version). As a consequence, you will have to add all but the body code manually after publishing.

If you don’t feel comfortable about doing that (and there is no reason to be nervous about adding small code snippets), your only other option is to use a third-party option such as Disqus. Their embed code is usually wrapped in an iFrame that can be added to the body of your normal html pages. This is because the script, stylesheets etc. are all running on a third party server that does the work. Your site only has to display a portion of their page as a window in your site.

1 Like

@francbrowne, thank you for your thoughtful response. After mulling over it and looking at alternatives, I’ve decided to go your way. I’m now purchasing the script for installation. Big thank you for your input!!!

If you get any issues with the script, be sure to let me know - I have the whole library so I know most of the issues that can occur. Best to let me know via PM as such issues are unlikely to be related to Sparkle itself.

1 Like

I thank everyone for their valuable input. We can end this topic now, however, because I have decided to request reviews from our customers via email and post them to a Sparkle page.