Guide: Wordpress Plugin
This document provides information on how to utilize the Wordpress Plugin created for UW-Madison's Guide (Academic Catalog).
What does the plugin do?
In short, this plugin allows the web editors of departmental or School/College Wordpress sites to dynamically retrieve and display academic program information from within the Guide domain (https://guide.wisc.edu) directly on their own website. Since the UW-Madison Guide publication is updated three times per year, enabling this plugin will ensure that the academic program information displayed on the various campus websites will always be in sync with the governance-approved Guide content.
How does it work?
- Retrieve and display all content from a chosen Guide page/tab
- Retrieve and display specific content below a single H2 header on the Requirements tab
- Retrieve and display a range of content (e.g. all content before/after a chosen H2 header)
- Adjust all instances of one HTML element with another (e.g. change all H2 headers to H3 headers, or change an ordered list to a numbered list)
Usage
As is the case with many Wordpress plugins, the Guide content is called through the use of a shortcode : [guide_content]. This shortcode has one required attribute and several optional attributes.
Required attribute:
- url: This attribute determines the Guide page from which the user wants to retrieve content. Acceptable values can be found by navigating to the Guide page, clicking on the tab with the relevant content, and copy/pasting the url from the browser.
- Example usage:
- Note: If the url entered is not valid, or if it is not contained within double-quotes, the shortcode will not return any content to the Wordpress page
Optional attributes:
- exact: This attribute should be used when you wish to return content from a chosen H2 header on the Requirements tab.
- before: This attribute should be used when you wish to return all of the page content that appears before a chosen H2 header on the Requirements tab.
- after: This attribute should be used when you wish to return all of the page content after (and including) a chosen H2 header on the Requirements tab.
- adjust: When placing the shortcode within certain Wordpress Elements, such as an Accordion Panel Body, the UW-Theme will automatically reduce the size of H2 elements so that the end up being smaller than H3 elements. By using adjust, you can replace every instance of a tag with another (e.g. turn all H2 headers into H3 headers).
- Example usage:
- Notes:
- The adjust attribute only works on tags, this is not a "find-and-replace" feature
- You can enter as many adjusts as you want by separating them with a semicolon (e.g. adjust="h2-h3;h4-h5;ul-ol")
- When entering multiple adjusts, be sure to order them so that you don't accidentally adjust any tags that were already adjusted (e.g. adjust="h2-h3;h3-h4" would ultimately change all of the H2 and H3 tags to become H4 tags)
- grad: This attribute can only be set for a Requirements Tab on a Graduate plan/subplan page. The three standard H2 headers on a Graduate Requirements tab are "Mode of Instruction", "Curricular Requirements", and "Required Courses". This attribute allows the user to return the content from one of those three areas: "mode", "curr", and "courses", respectively.
- Example usage:
- Note: The only acceptable values for the grad attribute are "mode", "curr", and "courses"
- udr: This attribute can only be set for the Requirements Tab on an Undergraduate plan/subplan page. All undergraduate plan pages contain the "University Degree Requirements" table Setting udr to a value of "y" tells the plugin to add the "University Degree Requirements" information from the content to be displayed on the WordPress page.
- Example usage:
- Note: The only acceptable value for the udr attribute is "y"
Additional Usage Tips:
- For all attributes, capitalization does not matter, but spacing matters. It is recommended that you copy/paste the H2 header from Guide directly into the shortcode when using exact, before, and after to avoid typographical errors.
- Occasionally, the individual responsible for updating a Guide page will rename an H2 header, or reorganize the information on a page in such a way as to change what content would be displayed by the shortcode. For that reason, it is recommended that the Wordpress page editor notify the appropriate Guide Editor(s) that this Plugin is in use.
- A single Wordpress page may contain any number of shortcodes pulling from any number of Guide pages--there is no limit.
- Information from different Guide pages can be displayed on the same Wordpress page (e.g. Art History Cert Requirements and History Cert Requirements shown side-by-side)
- In some cases, an H2 header may have had a space inadvertently appended to the end of the string. Due to the way in which this plugin performs string-matching, if you attempt to use exact on that H2 header, it will behave the same was as the after attribute. A workaround for this is to instead use the after attribute on the H2 header containing the extra space, and add the before attribute with a value equal to the subsequent H2 header appearing on that Guide page.
- The before and after attributes can be used together in a single shortcode to specify a range of content that, but exact cannot be combined with before or after in the same shortcode. However, exact can be used in one shortcode, and immediately followed by another shortcode containing before and/or after to flexibly combine content from a Guide page to your Wordpress site.
Wordpress Installation
This plugin is only available at this time for UW-Madison WordPress sites with admin access to install their own plugins (i.e. those sites not managed by the WiscWeb team). Because this plugin was designed specifically for use at UW-Madison, the plugin cannot be installed directly via the WordPress.org Plugin Directory; however, interested users can follow these simple steps for installation:
- Download the plugin directory from Box here.
- Extract the contents of the .zip folder and move the guide_content folder to the Wordpress Plugins folder on your web server:
- From the Wordpress Dashboard, navigate to the Plugins tab:
- Find the Guide Content plugin on the list and click Activate:
Questions, suggestions, and requests for consultation can be sent to Eric MacKay in the Office of the Registrar at emackay2@wisc.edu.