George Mason University Antonin Scalia Law School

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.

PowerShell Script For Semester Batches

This is a script I’ve developed after relying on CMD for so long and needing to use PowerShell to quickly export file names in large .ZIP files.

Be sure to run as Administrator and make sure your execution policy is not restricted.

You can call the function whatever you like. Export-Csv converts objects into a series of strings. Read more here.

Function GetClassList([string]$path, [string]$outputFile) {
$list = Get-ChildItem $path -Recurse | where {!$_.PSIsContainer}
$list | Select-Object BaseName | Export-Csv $outputFile
}
GetClassList "C:\Users\T\Desktop\fall2018\batch5" "C:\Users\T\Desktop\fall2018\batch5\list1.txt"

First argument is the directory and the second is your file destination.

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.

 

 

Upgrading to PHP 7

This guide is for CentOS Linux systems running PHP 5.3 and up.

Start by logging into WHM and making sure the server is on Apache 4. Use EasyApache 4 to upgrade if necessary.

To upgrade PHP 7, SSH into the server and download Remi and EPEL Repository:

$ wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm
$ wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Enable the respositories:

# rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
FOR PHP 7.0 EXECUTE:
# yum-config-manager --enable remi-php70
FOR PHP 7.1 EXECUTE:
# yum-config-manager --enable remi-php71

Then upgrade to PHP 7:
# yum update

Events Planning Form Using Javascript

A short questionnaire to direct users to the right form using Javscript
window.onload = function() { document.getElementById('link1').style.display = 'none'; document.getElementById('link2').style.display = 'none'; }; //Clears div box

var x, y, z; //assigns variables to radio selections

function a1(answer1){ x = answer1; };
function a2(answer2){ y = answer2; };
function a3(answer3){ z = answer3; };

//if all answers are no, display link2 and hide link2; if any answers are yes, do the opposite.

function showdiv() { if (x==1 | y==1 | z==1){ document.getElementById('link1').style.display='block'; document.getElementById('link2').style.display='none'; } else { console.log("None of the questions is 1"); document.getElementById('link1').style.display='none'; document.getElementById('link2').style.display='block'; } return; }

//How to structure your HTML to code. Onlick assigns value to x,y,z variables

<input type="radio" onclick="a1(1)" name="q1">Yes
<input type="radio" onclick="a1(0)" name="q1">No

//execute code
<button onclick="showdiv()">What Form Do I Need?</button>

//hide show divs using IDs
<div id="link1">
Link 1
</div>
<div id="link2">
Link 2
</div>

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.

Creating Scalia Spotlights

This is specific to the Monthly Dean’s List Mailings found here.

1. Create a Resource using the News template. Give it a Title, Long Title, and Resource Alias.

2. On the Settings Tab, make sure the Parent Resource corresponds to the News>Year. The Published On field will be used to sort the article. Use the date the Mailing was delivered.

3. Under Template Variables, include an image (400px wide by 250px high). Copy and paste a blurb for the Spotlight/Feature Summary (usually the first sentence). Enter the Publication Date. Check off the categorie(s) that correspond to the article on the Categories list. Under Content, paste the entire article.

4. If an image needs to be included, upload the image and use the following code template:


<figure class="floatleft">
<img src="assets/images/news/mossoff_adam.jpg" alt="Professor Adam Mossoff" />
<figcaption>Professor Adam Mossoff</figcaption>
</figure>