We've designed this sample webpage to show you how to include the software into your own webpages.
This page also serves as an indicator of whether DoComments has been successfully installed: if you didn't see a popup error message when this page loaded, and if there aren't any error messages displayed below, then DoComments is working properly---congratulations! Otherwise, you can contact support for installation assistance.
Please click on a topic, below, for more information.
To include DoComments into your own webpage, copy and paste the following HTML into your webpage's HTML source code where you'd like comments to appear.
The above code assumes that your webpage is located in the top level of the DoComments directory, like the SampleWebpage.html file that you're viewing now. If your webpage is in a different location, then you'll need to change the paths to the 5 files that are referenced in the above code.
For example, say I've installed DoComments to jerrata.com/DoComments/, and my webpage is located at jerrata.com/index.php. index.php is not located in the top level of the DoComments directory, so I need to change those files' paths as follows:
Line Number
Existing Path
Modified Path
1
skins/default/styles.css
/DoComments/skins/default/styles.css
2
includes/scriptaculous/prototype.js
/DoComments/includes/scriptaculous/prototype.js
3
includes/scriptaculous/effects.js
/DoComments/includes/scriptaculous/effects.js
4
DoComments.js
/DoComments/DoComments.js
10
DoComments.php
/DoComments/DoComments.php
This table shows how I modified each existing path (on the specified line number in the above code) to form a modified path. How did I determine these modified paths? Let's break it down:
/DoComments/
The beginning forward slash instructs the browser to start looking for whatever follows the slash in the root directory. From the browser's point of view, /DoComments/ and http://jerrata.com/DoComments/ are equivalent.
/DoComments/
This is simply the folder into which I installed DoComments. If you installed the software into a different folder, use that folder's name here, instead.
When my browser reads jerrata.com/index.php, it'll load /DoComments/skins/default/styles.css (equivalent to http://jerrata.com/DoComments/skins/default/styles.css), and so on for the other files, as intended.
If you need help determining file paths or including the above code into your webpage, contact support.
Including The Topic Rating
The topic rating is the average of all visitors' ratings on a topic. To include it, copy and paste the following HTML into your webpage's HTML source code where you'd like the rating to appear.
This step is optional: you do not need to include the above code for DoComments to work properly.
Including The 'Post Comment' Link
To include a link that opens the post comment form, copy and paste the following HTML into your webpage's HTML source code where you'd like the link to appear.
Since this is an ordinary HTML link, you can place it anywhere on your webpage, use different text, replace the text with an image, and so on.
To display a different topic's comments for each webpage that includes DoComments, look for this line in the HTML code that you copied and pasted:
topic: 'change_me',
Change change_me to the topic name of your choice. For example,
topic: 'My Brand New Topic',
If your topic name contains single quotation marks ('), be careful to escape them with a backslash:
topic: 'Johnnie\'s Brand New Topic',
If you're an advanced user, you may want to:
Copy and paste the DoComments code into your site's header, footer or other common module so that comments show up automatically across your entire site.
Edit the default skin that controls the appearance of comments and the post comment form. This skin is located in the /skins/default/ folder.
Create a new skin. The easiest way to do this is to use an existing skin as a base, make your changes to that and then update the DoComments code to use the new skin. Specifically,
Copy an existing skin's folder to a new folder in the /skins/ directory. For example, copy /skins/default/ to /skins/newSkin/.
Make your changes to the files in /skins/newSkin/.
Edit the HTML source code of the webpage(s) that you want to use the new skin. Look for this line:
skin: 'default',
Change default to the name of the directory in which your new skin resides. For example,