Skip to main content

Posting Questionnaires

This tutorial explains how to add a new round of questionnaires to a cohort's questionnaire page. The example below uses R22 (2025) of the NLSY97, but the same process can be used for any cohort and round.

Overview

The Questionnaires page displayed under Other Documentation is not a single editable page. Instead, it is a view that combines individual questionnaire pages for each round into one listing. To add a new questionnaire round, you will:

  • Clone the most recent questionnaire page
  • Update the page title and summary
  • Upload the new questionnaire files
  • Replace links with the new file URLs
  • Add or remove questionnaire entries as needed
  • Give each questionnaire a unique ID
  • Update the page's URL alias
  • Verify all links and publish the page

Step 1: Locate the most recent questionnaire page

Navigate to: NLSY97 → Other Documentation → Questionnaires

Scroll to the bottom of the list to identify the most recent questionnaire round available. In this example, the latest questionnaire page is R21 (2023).

Find the individual page to clone:

  1. Go to Manage → Content
  2. Search for the most recent questionnaire page. You can search by:
    • Cohort = NLSY97 and Section = Questionnaires, or
    • Title = R## Questionnaires (replacing ## for the round number, Ex: R21)
  3. Open the existing questionnaire page by clicking its Title

page search


Step 2: Clone the page

  1. Click Clone
    clone button
  2. Update the following information:
    • Title: Remove "Clone of" and change the round
      • Example: "Clone of Round 21 Questionnaires" → "Round 22 Questionnaires"
    • Summary text: Update the year and round
      • Example: "2023 | Round 21" → "2025 | Round 22"
        summary disclosure (html widget)

Step 3: Upload questionnaire files

The next step is to upload the HTML questionnaire files that will be linked to the page.

  1. Scroll to the Attachments section (near the bottom of the page)
  2. Click Choose Files
  3. Browse to the folder containing the questionnaire HTML files.
  4. Select all questionnaire files
  5. Click Open

Note: Attaching files does not automatically place them into the page content. The files are copied into Drupal's file directory and become available for linking.

choose


Step 4: Collect the new file URLs

After the files are attached:

  1. Click an attached filename in the list.
    attachment file list
  2. Copy the file path beginning with: /sites/.... and ending with: .html
    • Example: /sites/default/files/attachments/2026825/1.Household%20Information.html
    • dialog window showing file URL

Notes:

  • %20 in a URL represents a blank space in the filename.
  • The URL will contain the upload date.
  • If a file has been uploaded previously on the same day, Drupal may append _# to the filename to differentiate the new version in the directory folder.

Optional:

Collect all of the URLs into a text list while in the Attachments section before scrolling up to the editor to enter them. This will save time from scrolling back and forth.


Step 5: Replace existing questionnaire links

  1. Return to the Body section (near the top of the page).
  2. Expand the questionnaire sections (clicking and expanding the summary disclosure -screenshot in step 2).

Note: The HTML icons may appear stretched within the editor. This is normal and does not affect the published page.
large html icon in editor textbox

For each questionnaire:

  1. Locate the questionnaire link
  2. Click the link
  3. Select Edit link
    edit pencil
  4. Replace the old URL with the new URL copied from the attachment
    url link field
  5. Revise the Displayed text to match the file (if this has changed).
  6. Click Update

Repeat for every questionnaire in the list. See step 6 for adding or removing questionnaires.


Step 6: Add or remove questionnaires

Questionnaire lists may change from one round to the next.

Remove a questionnaire

If a questionnaire no longer exists in the new round:

  1. Click Source (to enter the code view)
  2. Search for the questionnaire name
  3. Locate the corresponding <li> element
  4. Delete the entire list item from opening <li> to closing </li>

Example

Round 22 no longer includes a Health Behaviors questionnaire. Removing the following code, removes the entire bullet point including the HTML icon.

<li data-list-item-id="ee83868eab95de5fcf61db920be18fba8"> 
    <p class="file-icon" id="r21-15"> 
       <img alt="html icon" src="/sites/default/files/icons/file-html.png">
       <a href="/sites/default/files/attachments/24027/15.Health%20Behaviors.html">
            Health Behaviors</a> 
    </p> 
</li>


removed html code

Add a new questionnaire

When adding a questionnaire:

  1. Click Source
  2. Copy the following code:
    • <li> 
          <p class="file-icon" id="rXX-X"> 
             <img alt="html icon" src="/sites/default/files/icons/file-html.png">
             <a href="/sites/default/files/attachments/">QUEX NAME HERE</a> 
          </p> 
      </li>
  3. Paste it into the appropriate location
    new html code
    • Hint: While in the normal editor view, add a placeholder bullet point where you'd like to add the file. Then in the Source view, search for that placeholder to replace with the above code. Make sure to delete the <p></p> tags that the editor wrapped your placeholder text in by default.
  4. Click Source to return to the normal editor view.
  5. Update the Link URL and Displayed text (same as step 5).
    link editor

Step 7: Update associated IDs

Each questionnaire item has a unique ID so it can be targeted (if needed) in a programmatic way.

Update the ID attributes:

  1. Click Source to enter the code view.
  2. Search (CTRL+F) for id="r to highlight the IDs.
  3. Change the round number and append with incrementing numbers:
    • Example: id="r22-1", id="r22-2", ..... id="r22-n"
      unique IDs highlighted in source code

Step 8: Update the page URL alias

The URL alias is the user-friendly web address displayed when visitors access the page. When the page was cloned, it was assigned a node number as its default URL.

Example: https://nlsinfo-dev.chrr.ohio-state.edu/node/893

We will set the URL alias:

  1. Re-open the page you cloned. In this example, R21 Questionnaires.
  2. Copy the URL alias from the right column.
  3. Paste it into the new page's URL alias field and update the round number at the end to match the content.
    • Example: /content/cohorts/nlsy97/other-documentation/questionnaires/round-22
    • When the page is saved, the node number will be replaced with the alias text.

Notes: 

  • The URL alias starts with /content/
  • The URL alias also contains the cohort, e.g. /content/cohorts/nlsy97/ so don't mix cohort aliases or the page will populate in the wrong cohort section.

Step 9: Save the page and verify links

  1. Click Save (bottom of page)
  2. Click each questionnaire link to verify that they're working.
    • Hint: Hold CTRL while clicking link to open in a new browser tab.
  3. Confirm that the correct questionnaire opens with each link.
    • The HTML page reflects the new round (should say R## at the top of the opened questionnaire file).

This completes the creation of the new questionnaire page.

Navigate to: NLSY97 → Other Documentation → Questionnaires

Check that the new page has been added to the main questionnaire list and that the summary disclosure expands to reveal the round's linked files.

If everything looks good and links open the correct files, email CHRR.help to:

  1. Upload the linked questionnaire files to the code repo, and then
  2. push nlsinfo-dev to nlsinfo-staging for testing.

After you have tested the page and linked files on staging, IT can push it to production.