PT Page Rating Install v2

From ADF Docs
Jump to: navigation, search

Site Configuration

  • Make sure the ADF is setup and running on the site. If the ADF is not setup, then follow the instructions for ADF Installation.
  • Open the sites 'ADF.cfc' ( See Site Configuration (ADF.cfc) for more info) file in a text editor. Locate the Load the ADF Application into application space comment in the file. Add the following command under the comment section:
loadApp("ptPageRating");

Element Import

  • Import the following elements from the /ADF/apps/pt_page_rating/exported-objects/ folder:
    • PT-Page-Rating-Custom-Element.zip

CCAPI Configuration

ccapi.cfm configuration

  1. Navigate to your ccapi.cfm page (or create one)
  2. Add the PT Page Rating Element to the page
  3. Click on the More under the PT Page Rating Element and select name
  4. enter the name: ptPageRating
  5. Submit the page

XML Configuration

  1. Open the _cs_apps/config/ccapi.xml (or cfm) document
  2. add the following:
<ptPageRating>
  <pageID>[ccapi.cfm page ID]</pageID>
  <subsiteID>[subsite ID ccapi.cfm lies in]</subsiteID>
  <elementType>custom</elementType>
  <controlName>ptPageRating</controlName>
</ptPageRating>

Subsites

It is highly recommended to create a Page Rating subsite for administrators. This allows security to be setup for the subsite to allow only administrators access for the webadmin.

Your site may already have a webadmin subsite. The steps below will add a pagerating subsite into the webadmin subsite.

Web Admin

  1. Create a new subsite under the site root called webadmin.
  2. Create a new subsite under webadmin called pagerating.
  3. Configure the /webadmin/pagerating/ subsite Content Security to give 'No Rights' to 'Anonymous Users' and 'Authenticated Users'.
  4. Configure the /webadmin/pagerating/ subsite Content Security to give permissions to the group of administrators who will manage the Comments.

Page Rating Manager

This page will be used to manage the Comments custom element data records for the site.

  1. Create page with the name "index" and title is "Page Rating Manager" in the /webadmin/pagerating/ subsite.
  2. Add a Datasheet element into the page.
    1. Define a View for the Datasheet Element called "All Page Ratings"
    2. Leave the View Source as the Default: Form Result/Custom Element Sheet
    3. Select the "PT Page Rating" Custom Element and select the following columns:
      1. ID, UserID, RatingPageID, Rating, and Date Added
    4. Edit the column for the "ID" field and make the following changes:
      1. Header: Edit/Delete
      2. Render Handler: /ADF/extensions/datasheet-modules/1.0/edit-delete.cfm
    5. Edit the column for the "UserID" field and make the following changes:
      1. Header: User
      2. Render Handler: /ADF/extensions/datasheet-modules/1.0/userID-to-name.cfm
    6. Edit the column for the "RatingPageID" field and make the following changes:
      1. Header: Rating Page
      2. Render Handler: /ADF/extensions/datasheet-modules/1.0/pageID-to-link.cfm
      3. Prevent Text from Wrapping: Unchecked
    7. Edit the Layout properties for the datasheet:
      1. Default Sorting: Date Added DESCENDING
      2. Results Per Page: 50
      3. Allow JavaScript data sorting: Uncheck
  3. Publish the page.

Adding rating to Your Pages

There are 3 options for adding the ratings to your pages:

  1. Base Plus One Template controlled through custom metadata - This will allow the all the site pages to have a metadata option to show or hide the page rating element .
  2. Template - Add the page rating custom script into a template and then all the pages derived from this template will have page rating.
  3. Page - On a page by page basis a custom script can be added directly into the page to display the page rating module.

The following steps will outline the 3 install options.

Base Template

  1. Create a new custom metadata form, or add to an existing custom metadata form (preferably if you have a custom metadata form for layout options this would be a good place).
  2. Add a new "checkbox" field with the following values:
    1. Field Name: displayPageRating
    2. Type: Checkbox
    3. Label: Display Page Rating
    4. Description: Check this field to display the Page Rating module into the page for all users.
    5. Properties: You have the option here to default this value to checked by default.
  3. On the Base Plus One Template
    1. Add a custom script module into the container or area of the page for the page rating.
    2. Define the explicit path for the following:
      1. /ADF/apps/pt_page_rating/customcf/pageRatingMetadataValidate.cfm
      2. Important Note: Based on your custom metadata form this custom script MAY need to be customized for your implementation.

Template/Page

  1. Navigate to your template or page.
  2. Add a custom script to the page (under Miscellaneous)
  3. Specify the location of the custom script to be:
    1. /ADF/apps/pt_page_rating/customcf/pageRating.cfm
  4. Submit the page.