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 “2015 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.