Documentation:Documentation:Digital Tattoo Student Orientation/Website Technical Documentation/Commenting and voting

From UBC Wiki

Evaluate and Pulse are two WordPress plugins which allow readers to vote on posts/pages and comments, respectively. The long-term purpose of these plugins is to integrate with the digital badging system: voting and rating content will be one pathway to earning badges. In the shorter term, these tools will allow us to see which content is being produced that's most useful/appreciated by the community, and highlight any areas where we're lacking/falling behind. Gravity forms can also be used to vote on content: right now, they are implemented on DIY Media as opposed to Evaluate.

At current, Pulse is not installed on Digital Tattoo, due to interference with the Learning Wrapper.

Evaluate

Evaluate is a UBC-developed plugin which allows for the rating of content like pages, posts, and comments.

Voting on pages and posts

While Evaluate is used for comments, the comment-rating functions require use of Pulse, and will be explained further down the page.

Creating a new metric

  1. Go to the dashboard of the website you have Evaluate installed on.
  2. Go to Evaluate > Add New
  3. Give your metric a name, type, and select where it should be displayed.
    1. Pulse cpt is comment-based voting. Post, page, and attachment are content-based voting.
    2. I'm not clear on the current functionality of being logged in to vote. Specifically, I'm not sure how 'average' users (students without blogs, individuals without UBC CWLs) would log in, given the lack of an obvious button.
  4. After you've clicked 'save changes', the metric will be applied to all selected page types.

Removing voting on pages/posts

As things currently stand, implementing a metric will apply that metric to all pages, regardless of whether it makes sense for them to be searchable or not. To remove voting from a page, follow these steps.

  1. Edit the page in WordPress.
  2. In the lower right, there should be a box titled 'Evaluate'. Select the metrics you wish to remove from that page.

Viewing metric results

  1. From the dashboard, go to Evaluate > All Metrics
  2. Mouse over the metric you've created, and click 'view details'.
  3. You'll be able to see a detailed breakdown of the votes each piece of content has received, including being able to sort by vote count.

Changing the current voting system

  1. Right now, it seems impossible to edit a metric once votes have been applied to it.

Evaluate CSS

Metrics are current wrapped in a coloured box to make them stand out more. The following CSS, when added anywhere to the custom CSS for a WordPress page, will create a coloured, shadowed box.

/*Start Evaluate styling*/

/* adds box w/shadow to voting */

.evaluate-shell { -webkit-box-shadow: 2px 2px 5px 0px rgba(50, 50, 50, 0.43); -moz-box-shadow: 2px 2px 5px 0px rgba(50, 50, 50, 0.43); box-shadow: 2px 2px 5px 0px rgba(50, 50, 50, 0.43);;

padding: 0.4em;
width: 25%;
background-color:rgba(220, 234, 189, 1);

}

/*End Evaluate Styling*/

Occasionally, the box extends too high on the page. This is caused by improperly closed tags on the WordPress entry. To solve this, edit the page, switch to text view, and read through, looking for opening tags without a corresponding close tag. Typically, the solution is a </div> or </ul> tag at the end of the page.

  • Adding four or five of each closing tag to the end of each page will likely fix the problem. While adding extra closing tags at the end of a page doesn't interfere with the site's functionality, it's confusing for anyone editing the page, and really bad practice, so please use this only attempt this as a temporary fix on urgent pages.
    • If you can't find the tag that needs closing, adding a large number of closing tags and removing them one-by-one until the minimum number of tags needed is discovered will likely solve the problem, although, again, this is somewhat bad practice.


Creating and applying a new metric

  1. Create a new metric in Evaluate. When selecting where it should be displayed, selected 'Pulse cpt'.
  2. Go to Appearance > Plugins
  3. Go to 'After Content'. If Pulse is not already there, drag it in.
  4. In the Pulse box, change the metric selected in the 'Pulse Rating' and 'Display Comment Rating' dropdown boxes to your new metric.

Removing Pulse on certain pages

As things currently stand, Pulse is active on all pages of any site it is applied to, regardless of whether or not it makes sense to have comments on that page. Follow these steps to remove Pulse comments from a page.

  1. Edit the page in WordPress.
  2. In the lower right, there should be a box titled 'Pulse CPT'. Select 'disable Pulses on this page'.

Viewing metric results

  1. This is handled the same way as Evaluate ratings: find the metric in Evaluate and click 'view details'.
    1. As things stand, I think there are bugs in the system: we currently have votes on pages with no comments

Changing the current voting metric

  1. Changing metrics after someone has voted using that metric currently seems impossible.

Gravity Forms

Gravity Forms is a contact form plugin for WordPress-based websites. Due to its success and popularity, Gravity Forms has become more versatile than a simple contact form.

Voting on pages and posts

By creating a properly-formatted metric, Gravity Forms can ape the functionality of Evaluate, while offering features Evaluate doesn't, like IP address tracking, page referrals, and conditional logic.

Creating a new metric

To create a new metric identical to the one currently on DIY Media, follow these steps.

  1. Navigate to the dashboard of the site you want to implement voting on. Click the 'Forms' section on the sidebar, and then 'Add New' to create a new form. Give it a title, and, optionally, a description.
  2. Click the 'Radio Buttons' button, and mouse over the text that appears. Click 'Edit' in the upper right hand corner.
  3. Give the section a name, and adjust the choices to what you want. For our form, we'll name it 'Was this helpful?' and we'll label the options 'Yes!' and 'No!'. The field will start with three choices by default. To remove choices, click the '-' button next to option you want to remove. To add choices, click the '+' button.
    1. To prevent blank replies, click 'Required' under 'Rules'.
  4. Click on the 'Paragraph Text' button on the side, and name the field. For our form, we'll name it 'Why not?'.
  5. Go to the 'Advanced' tab. Scroll down, and click 'Enable Conditional Logic'. Change the settings so that the field will be shown if 'Was this helpful' is 'No!'. This way, if someone leaves negative feedback, they will have the option of providing a reason.
  6. To ensure that you can tell where each response came from, add a hidden field: click 'hidden' in the list of standard fields. Go to the advanced tab, and scroll down to the 'Embed Post/Page ID' option. Select that, and click 'Allow field to be populated dynamically'. This will attach the title of the page the vote came from to each response, out of sight of the user.
  7. Hit 'Update' to save the form.

Applying the form to pages

  1. In order to apply the form to a page, edit the page, and flick 'Add Form'. A window will appear prompting you to select one of the forms you have saved on your site. Alternately, you can copy and paste the following code into your page, replacing X with the ID of the form (which can be found on the form page, YOUR_NAME with whatever you choose to name your form.
    [gravityform id="X" name="YOUR_NAME" title="false" description="false"]
  2. UBC has an issue with their WordPress theme where Gravity Forms with conditional logic don't display unless forced. To force forms to display, you have to add the following to your custom CSS. Replace the X with the ID of the form, which can be found on the forms page.
    #gform_wrapper_X {
    display: block !important;
    }

Viewing the form results

Currently, viewing the results is somewhat difficult to do in an ordered fashion. I'm working on a Google Sheet which you can paste the .csv values of the results into, which will automate the process.

Spam

  • Currently captcha is installed on Gravity Forms to prevent from Spam post