George Mason University Antonin Scalia Law School

Kiosk Database List

The Kiosk page is handled by a MODx Ditto. Each entry can be found within the “Find Books, Articles, and Databases” bucket inside the MODx Tree.

To edit the description of an individual entry, navigate to the Template Variables tab, click on “Library” and edit the Description field. Make sure not to include any HTML code inside this field.

Course Schedule Conversion for MODX

This tutorial walks through the steps to convert course schedule from Excel file into MODX.

  1. Open up the original Excel file (provided by Deborah), merge multiple faculty into one row, then delete all the empty rows.
  2. Open up the Course Schedule Sample Excel file
  3. Copy and paste each column such as Course Title, Credit, and Course Number into the sample Excel file. Do it for both Day and Evening courses.
  4. Once everything is in place, copy all (except for row 1) from the Excel file to an HTML editor:

    <div class="table-wrap">
    <table id="course-schedule" class="sortable" border="1" cellspacing="0">
    <tbody>
    <tr>
    <th>Sched.</th>
    <th>Course Name</th>
    <th>Num. (Sec.) CRN</th>
    <th>Instructor(s)</th>
    <th class="unsortable">Days, Time</th>
    <th>Final Exam</th>
    <th class="unsortable">Syllabus</th>
    </tr>
    <!--SCHEDULE STARTS HERE-->
    <!--Paste the table from Excel into here-->
    <!--SCHEDULE ENDS HERE-->
    </tbody>
    </table>
    </div><!--end table-wrap-->

  5. Save as an HTML file and view it in the browser. Clean up all the extra spaces using Search & Replace. For examples: ( 3 cr) to (3cr) and ( 001 ) to (001)
  6. Next, perform Search & Replace for notes items: //, (W), (E), +, and (N.1) to (N.9)


    <a href="[[~[[*id]]]]#permission" title="With witten permission of instructor only.">//</a>

    <a href="[[~[[*id]]]]#writing" title="This course has been designated as a writing course.">(W)</a>

    <a href="[[~[[*id]]]]#experimental" title="This course has been designated as an experiential course.">(E)</a>

    <a href="[[~[[*id]]]]#prerequisites" title="This course has prerequisites.">+</a>

    <a href="[[~[[*id]]]]#n1" title="See Note 1">(N.1)</a>

    Note that (N.1) to (N.9) are different for Day than Evening. For Evening change the anchor ID from #n1 to #n1-eve.

  7. Copy and paste notes from the original Excel file to the bottom of the HTML page. Reformat the notes to include all the anchor links.
  8. Once everything looks good, paste into MODX

    Change text case

    This step is not required, but here’s are tips for change the case of text in Excel.

Setting up an RSS Feed Parser in MODX

MODX uses an add-on called getFeed to parse RSS content.

In order to use it, place this code on your page template (example uses the Faculty News Feed):


[[!getFeed?
&url=`https://sls.gmu.edu/faculty-news/feed/`
&tpl=`RSSFeedParser`
&limit=`1`
]]

The code pulls the RSSFeedParser, a custom chunk we made that pulls the most recent article title and link.

Titles are pulled using:

[[+title]]

Links are pulled using:

[[+link]]

Here is a list of other data fields that may be pulled from the RSS Feed, if available:

  • title – The title of the post.
  • link – A direct link to the post.
  • description – The description of the post.
  • pubdate – The date the post was published.
  • guid – The GUID of the post.
  • author – The name of the author of the post.
  • category – Any tags or category associations the post has.
  • summary – A short summary of the post.
  • date_timestamp – The timestamp of the post.

Like most MODx variables, wrap the data fields with double square brackets, but be sure to use the + sign prefix rather than the * symbol.

Full-Time Faculty Table

The Full Time Faculty Table implements one ditto that calls two separate chunks.

The chunks are:

ditto.people_finder.odd.tr.2018

and

ditto.people_finder.even.tr.2018

The structure of both dittos are the same, with only the row background color being different using the existing even and odd classes within the main style sheet.

When calling the ditto, filter the results using:

&parents=`5842,1794`

This sorts the list based on Faculty Type.

When adding fields use the + sign instead of the usual *, so to add the professor’s title, it would look like this:

[[+title_main]]

To integrate a link, use this format:

<a href="mailto:[[+email]]"">[[+email]] </a>

Main Site Top Navigation Bar

Assigning new pages to different sections of the site are done within the resource itself under Template Variables.

However, adding sections to the Top Navigation Bar requires manually editing a Chunks within MODX.

To add a new Admissions Program to the Admissions section, for example, Navigate to Elements, select Chunks, then Navigation, and select the nav_admissions chunk to manually add the page. Be sure to use Resource IDs in place of the URL.

Main Site Hompage and Slider

The main site homepage is comprised of two different templates.

Slider edits can be made through the “2015_home_banners” template. Must go through Files -> Assets -> Templates to find.

The bottom half of the homepage is through the “2019 Home” template. Must go through Elements -> Templates to find.

Two versions of the Carousel image must be uploaded, the desktop and mobile version.

Approved font for Carousel image is Myriad Pro Condensed Black, but Myriad Pro Condensed Bold is an appropriate substitute.

Trouble Viewing Published Material on MODx?

If you’re making an edit to an existing page that has been unpublished in the past, be sure to take an extra look at the “Hide Template Variables on Output” field.

The field is located under most page templates under Template Variables -> Templates – Default TVs:

It varies, but the field in most page templates can be found at the very bottom of the page:

 

A Template Variable or TV, is simply what MODx calls a custom field found in page creation forms. When this field is set to “Yes” and the page is published, no content will be viewable.

This field is set to “No” by default and should not be a problem when creating new content.

 

 

Creating Working Papers

Faculty Working Papers are created in one of two categories. This guide goes over both Law & Economics Working Papers as well as Legal Studies Working Papers.

Step 1. Navigate to the Faculty Working Papers directory on MODx found under: Resources > Publications > Faculty Working Papers

Create a New Article by selecting the New Article button.

Step 2. Name the article using the Article Title field.

Step 3. Scroll down the same page and under the Uses Template field, select Publications – Working Papers template found on page 3 of the drop down menu.

Step 4. Navigate to the Template Variables tab and make sure you are on the Documents sub-section.

Enter the Title & Publication Year/Month/Day

Depending on the category, Either the Law & Economics No. field OR the Legal Studies No. field must be filled in. The naming convention is subject to change. Please contact the Head of Reference and Instructional Services for the most up to date information.

Step 5. Under Text Availability select Abstract and Full Text and SSRN. Almost all working papers include all three items. Then upload a PDF copy of the working paper using the PDF field. Make sure it’s under the publications/working_papers directory.

Step 6. Paste the abstract into the Abstract text field. The abstract is usually included in the working paper. If not, the first paragraph will usually suffice.

Step 7. Select the Author(s) from the checklist.

Step 8. In this field, Type the ID numbers of each author. If there are multiple authors, separate each by a comma (e.g.:  123,456,789). Do not include a blank space between IDs.

Step 9. Scroll back to the top and select the Publications sub-section, still under Template Variables. Under SSRN Of Document, paste the SSRN link provided to you. This link is provided usually provided by a Scalia Law staff member.

Step 10. Finally, select Save to publish the Working Paper.

List All Sites Using Custom Shortcode

Shortcodes make it easier to customize wordpress pages quickly. WordPress comes with pre-built shortcodes but we’re going to build one from scratch. You will need to add a function to your child theme’s functions.php file. This particular code builds an ordered list of all our wordpress sites under our sls.gmu.edu domain using the get_sites() function. This function will work on all WP platforms 4.3 and above.


/*
* Author: Matthew
* This function creates a shortcode usable in all sites using the scalia law theme to create an ordered list of
all multisites
*/
function scalia_list_sites() {

$subsites = get_sites(); //creates variable using get_sites

if ( ! empty ( $subsites ) ) {

$html = '

    '; //sets up class

    foreach( $subsites as $subsite ) {

    $subsite_id = $subsite->blog_id; //finds sites by id
    $subsite_name = get_blog_details( $subsite_id )->blogname; //creates variable for site name
    $subsite_link = get_blog_details( $subsite_id )->siteurl; //creates variable for site url
    $html .= '< li class="site-' . $subsite_id . '">< a href="' . $subsite_link . '">' . $subsite_name . '< /a >< /li >'; //builds individual list items
    sort($html);
    }

    $html .= '< /ol >';

    return $html; //returns the list

    }

    }
    add_shortcode('scalia_list', 'scalia_list_sites'); //calls function and sets up [ scalia_list ] custom short code

    This goes in your child-theme’s functions.php file.