WiscWeb - Policy Library list display
Users may have a need to integrate a list of their policy documentation from the Policy Library on a page of their WiscWeb site. This solution allows you to create a list from a wpDataTables table. Note: This is more complex than typical WiscWeb processes.
Step 1: Copy the Policy Library category URL
The first step you will need to make is to locate the URL of the Policy Library category of items you would like to include on your WiscWeb page:
-
Navigate to the Policy Library
-
On the homepage, select one of the links listed in the Browse by Topics section, towards the bottom of the page
-
Select the desired category from the left-hand “Topic” menu
-
Sort the list by policy number using the “Sort by Relevance” drop down at the top of the search results
-
Copy the URL for that page into a new browser tab
Step 2: Updating the Policy Library category URL
The second step is to augment the URL you copied earlier so that it references the JSON directory and appends some needed syntax to the end. Note: Without these edits, the link will not pull any data into wpDataTables.
-
In your new tab with the category URL pasted in, put your cursor after policy.wisc.edu
https://policy.wisc.edu/?f%5Bcategory_ssim%5D%5B%5D=Information+Technology&q=&search_field=all_fields&sort=policynumber_is+asc
-
Add a slash / and type in /library.json
https://policy.wisc.edu/library.json/?f%5Bcategory_ssim%5D%5B%5D=Information+Technology&q=&search_field=all_fields&sort=policynumber_is+asc
-
Put your cursor at the end of the entire URL
-
Add &flat=true at the end of the URL
https://policy.wisc.edu/library.json/?f%5Bcategory_ssim%5D%5B%5D=Information+Technology&q=&search_field=all_fields&sort=policynumber_is+asc&flat=true
-
Press return on your keyboard and make sure you see a page of JSON results (looks like a bunch of code on a page)
-
Copy the full URL of this page
Step 3: Creating the wpDataTables table
The third step is to create your table in the wpDataTables plugin.
-
Make sure the plugin is activated on your site. If activated, you should see a wpDataTables link in your left-hand menu in WiscWeb. If not present, you can activate it by following the instructions in KB 102954
-
Select wpDataTables from the left-hand menu
-
Choose Create a Table
-
Select the “Create a data table linked to an existing data source” option
-
From the “Input data source type” drop down, select JSON
-
Paste in your altered URL
-
Create the table
Step 4: Edit your table fields
The fourth step is optional. When you enter your URL and create the table, it will bring over several more columns of data than what you are likely wanting to display. You may also want to edit the headings for your columns.
-
After creating the table, you should see a table preview. This preview shows the table of data with some gear icons next to each column heading
-
Click on the gear icon to make changes to those columns
-
To rename your columns, augment the “Displayed header” field to have a more intuitive title and save your changes.
Example: Rename the “policynumber” header to “Policy Number” -
To remove a column from being displayed, un-check the box that says “Visible on front-end: Show column in front-end” and save your changes. Repeat for any columns of data you’d like to remove.
Tip: We recommend keeping the Title, Policy Number, and Policy Link options only as it can be challenging for the user to read if too much data is included -
Make sure to save any changes you make
Step 5: Place the table on a page of your site
The final step is to copy the shortcode for your newly created table and paste it onto the page you wish to display it on.
-
Scroll to the top of your table and click the copy button next to the title to copy your shortcode
-
Navigate to your desired page
-
Paste this shortcode in a Text Block
-
Save your page