Railfan season for 2024 has begun!

Normally, most of my railfan activity goes into hibernation for the winter and doesn’t resume until March or so, when snow has started to melt and the sun gets high enough in the sky to avoid causing too much glare. However, due to some unseasonably warm weather, I started a bit early this year. Just as I started railfan season in 2021 with the Union Pacific/Northwest Line, I went back to the same line this year. Last Sunday, I went to all the stations between Barrington and Des Plaines using a combination of Metra and walking. It was a cloudless sky, perfect for some bright, vivid colors.

Outbound platform at Mount Prospect, looking southeast
Mount Prospect
Tracks at Barrington, looking northwest
Barrington

Hopefully I’ll knock out a big chunk of the remaining stations this year. I have photographed 147 stations so far, leaving me a little under 100 to go. Some of them will be easy to get to, but some of them will be a lot more difficult, being only served on weekdays, having infrequent weekend service, or not being accessible on foot. I will find a way, so stay tuned for a lot more Metra photographs, and eventually photos of every station.

Also coming up this year is Double Track NWI. I have been out to Indiana to photograph construction progress and made it to Michigan City less than a week after service resumed there, but this year it all will be completed. I’ll be out as soon as I am able after it all reopens. Hopefully I can be there right at the beginning, but life has a way of throwing schedule conflicts in my way, so we shall see.

The dawn of a new era in Michigan City

Two and a half years after the closure of the last of its kind street-running 11th Street station, the station has returned to life this past week. The South Shore Line is one of the last interurbans left operating in the United States, and until 2021 retained one street-running section in Michigan City. However, as part of a project to upgrade the line the street-running section needed to be removed since, despite how interesting it may be to railfans, it is slow, dangerous, and single-tracked.

Inbound train approaching 11th Street Station
Train on the old street running section in Michigan City

After a long period of running shuttle buses, the street running alignment has been replaced by a double track alignment with a one-way street adjacent to it. Here is a typical section:

Tracks west of Lafayette Street
New dedicated ROW for the South Shore Line and the street running next to it

The station itself has been replaced with a new modern station with high-level platforms instead of crossing a lane of traffic:

Inbound platform at 11th Street/Michigan City, looking east
Rebuilt 11th Street station

In addition to building new platforms, a new station building is planned, which will not only feature a parking garage and ground-level retail and a waiting area, but also feature apartments above the building.

On my trip to and from the station, we got to go fast. We were no longer crawling for two miles, but instead actually going fast. Boarding also was very quick thanks to the high platforms.

While most interurbans bit the dust decades ago, this one held on and has survived to today, and now is receiving some much-needed upgrades that will allow it to continue being a vital transportation artery for generations to come.

I have ridden the Regional Connector

I have been following the Los Angeles Metro since about 2014. In 2014 they had a bunch of different construction projects queued up, and I was eagerly following them to the extent I could from the other side of the country. The first project to come to fruition since I started following them was the Expo Line (now E Line) Santa Monica Extension, which I got to ride only a few months after it opened.

Downtown Santa Monica Station full view
Downtown Santa Monica, terminus of the Expo Line extension

One project that I was really excited about was the Regional Connector, a tunnel downtown which would bridge a gap in the light rail system. Prior to the Regional Connector, to get from a station on the Blue or Expo Line to the Gold Line, you had to take the Red or Purple Line, meaning that a trip from the Westside to Pasadena would require three trains. This obviously wasn’t an ideal situation and was never intended to be a permanent solution, but was the status quo for roughly two decades. However, that gap has now been bridged by the Regional Connector, which breaks the former Gold Line into two pieces and joins each piece with one of the lines coming out of 7th Street/Metro Center. Now we have the A Line from Long Beach to Azusa and the E Line from Santa Monica to East LA.

I immediately noticed the different going from the Westside to Chinatown. Instead of a transfer at 7th Street/Metro Center and then another transfer that involves a long escalator and a lot of walking at Union Station, I could just change trains in the tunnel, saving me a lot of time and walking.

In addition to making getting around easier for people going across Los Angeles, this project also improves connectivity downtown by opening two new stations. The stations are, in my opinion at least, pretty impressive.

Platform at Little Tokyo/Arts District
Platform at Little Tokyo
Entrance plaza at Little Tokyo/Arts District
Entrance at Little Tokyo
Platform at Grand Ave Arts/Bunker Hill
Platform at Grand Ave Arts/Bunker Hill
Entrance at Grand Ave Arts/Bunker Hill from across the street
Entrance at Grand Ave Arts/Bunker Hill
Platform at Historic Broadway
Platform at Historic Broadway
Entrance at Historic Broadway
Entrance at Historic Broadway

In all, I’ve been waiting years for this to happen and am glad to see it come to life. A lot more is coming to the Los Angeles Metro in the coming years and I am excited to see it.

We’re halfway there

Since May 16, 2021 the Chicago Transit Authority has been rebuilding the North Side Main Line between Wilson and Thorndale. The project involves replacing a century-old embankment with a more modern concrete elevated structure. Since it’s a four-track line, they are able to keep running trains on the line by rebuilding two tracks at a time and keeping the other two in service. For the past two years the two eastern tracks were being rebuilt while the two western tracks were still in use. Last Friday, on July 28, 2023 at 10pm, the two rebuilt eastern tracks on the new structure entered service.

Back in 2021 when they opened the first round of temporary stations, I was one of the first people to board at the temporary stations (according to the station attendant, I was the second person to board at the temporary Bryn Mawr station). I also was the last passenger to board at Berwyn.

Last northbound train at the old Berwyn station
Last northbound train at Berwyn
Temporary southbound platform at Bryn Mawr looking north, immediately after opening
First temporary Bryn Mawr station

Fast forward to last Friday, it was time for the next round of temporary stations. I arrived at Wilson on the second to last northbound train on the western tracks. The train was delayed about 10 minutes due to needing to remove an unruly passenger, but in the end the issue was resolved and everything continued according to plan. I then was able to catch the first train to use the new tracks:

First northbound train on Track 4 for RPM Phase 1B at Wilson
First train to run on the new tracks!

I took that train all the way to Thorndale, catching a picture of the temporary Argyle station through the open door while stopped:

Phase 1B temporary Argyle station from the first northbound train
Argyle station from a northbound train

I then continued up to Thorndale, where I was lucky to catch a southbound train right there. I took that one stop south to Bryn Mawr and got off there, where it still stopped at the old temporary station:

Penultimate southbound train at Phase 1B temporary Bryn Mawr station
Second to last train to operate at the first temporary Bryn Mawr southbound station

I got off there and walked over to the new temporary station (which is southbound-only). I also snapped a picture of the original station (which was temporarily serving as the northbound-only platform):

Entrance at the old Bryn Mawr station at closing time
Original Bryn Mawr station, temporary serving as the northbound-only platform

I continued on to the new temporary station, which will be southbound-only. The construction crew asked me to wait until they could confirm that they had rerouted southbound trains via the new tracks. While waiting, I got a few pictures of the entrance:

Fare mezzanine at Phase 1B Bryn Mawr immediately prior to accepting the first passenger
Fare mezzanine at the second temporary Bryn Mawr station
Phase 1B temporary Bryn Mawr entrance on opening night
Entrance at the second temporary Bryn Mawr station

Eventually they confirmed I could enter, and I was the first passenger to board at that station.

Platform at Bryn Mawr, looking south on Phase 1B opening night
Platform at the second temporary Bryn Mawr station

It turned out one more southbound train was rerouted via the old tracks, but then after that the first southbound train arrived.

First southbound train at Phase 1B temporary Bryn Mawr station
First southbound train (and first train) at the second temporary Bryn Mawr station

I took it one stop to Argyle and got off there:

Northbound track at Phase 1B Argyle temporary station, looking north
Second temporary Argyle station

The current temporary Argyle station is an interesting configuration. For one thing, it’s not actually on Argyle street, it’s a block north between Foster and Winona. Also the track configuration is very interesting. They are building a pocket track north of Argyle for turning trains around before reaching Howard, and so far they have built the two mainline tracks and the pocket track. The platform is actually built on top of one of the mainline tracks, with southbound train stopping on the pocket track. This means southbound trains need to go over a crossover both north and south of the station.

I also snapped some photos of the entrances:

Northern Argyle Phase 1B temporary station entrance on opening night
Northern entrance (on Foster)
Southern Argyle Phase 1B temporary station entrance on opening night
Southern entrance (on Winona)

Even for CTA, these were pretty subdued entrances, but that’s to be expected for a station that will only be around for two years.

After photographing Argyle, I caught the next train home.

Overall I am very excited to see this all come together. The new tracks were much smoother than the original tracks and the structure looks way better. Now over the next two years they are going to do the same work to the two western tracks and also build new stations at Lawrence, Argyle, Berwyn, and Bryn Mawr. We are reinvesting in our system and bringing it into the 21st century.

I should also mention I got unbelievably lucky with the weather. The whole time I was there, there was lightning all around, but somehow the rain held off until right after I got home.

Photographing all of Metra… without a car

I am about halfway through photographing all of the stations on Metra right now. According to Wikipedia, there are 242 stations in the system, with two additional ones under construction. According to Flickr, I have photographed 120 of them so far (as of the time I write this there are three stations where I have the photos but haven’t uploaded them). My definition of a station may slightly differ from Wikipedia’s (for example I am counting Prairie Crossing on the North Central Service and Milwaukee District west as a single station), but regardless this puts me at about halfway done.

It certainly has been an adventure trying to photograph all of these stations when I don’t have a car. I was able to photograph the entire L system in about 2.5 years (and most of it was in 1.5 years after I moved here), but Metra is going to take a lot longer. For the L, the stops are mostly relatively close together, all lines run every day, and the frequencies are pretty good. Thus I was usually able to knock out 5-10 stations in a single expedition, using a combination of walking and trains between stations. However Metra isn’t so easy. For one thing, three lines don’t even run on weekends at all (I work a standard Monday-Friday schedule), so for those lines I’m limited to going during the week or finding alternate means to get to the stations. Then for the lines that do run on weekends, they run pretty sparse schedules, once an hour at best. Making things harder, way out in the suburbs the stations are often several miles apart and in many cases there isn’t any sidewalk or pedestrian path to take between them, limiting my ability to walk between them.

Despite these challenges, I have been able to get the photos I have so far. I was lucky enough that last summer, the Heritage Corridor offered promotional Saturday service, allowing me to photograph all but one of the stations on there (and the remaining one appears to be walkable from Joliet on the Rock Island District). I was also able to get a ride with a friend to photograph all of the stations on the SouthWest Service. The North Central Service will be more of a challenge, with so far only Antioch photographed (I took a day off work originally for another purpose but that ended up being cancelled, but since I still had the day off I took advantage of it being a sunny day).

For the other lines, I have used a combination of taking the train and walking long distances between stations where possible. For example there is a pedestrian trail between Ingleside and Fox Lake, allowing me to get those stations in one go. Also a lot of the stations closer to the city are in areas that do have sidewalks, allowing me to walk between them more easily (though it can still be a long walk).

Here are the tallies for each line, not counting the downtown terminus for each:

  • BNSF: 8 out of 25 (32%)
  • Heritage Corridor: 5 out of 6 (83%)
  • Metra Electric: 33 out of 48 (69%, including all stations within the Chicago city limits and on the South Chicago and Blue Island branches)
  • Milwaukee District/North: 6 out of 21 (29%)
  • Milwaukee District/West: 6 out of 21 (29%)
  • North Central Service: 2 out of 17 (12%)
  • Rock Island District: 15 out of 25 (60%, including all stations on the Beverly Branch)
  • SouthWest Service: 12 out of 12 (100%)
  • Union Pacific/North: 16 out of 26 (62%)
  • Union Pacific/West: 9 out of 22 (41%)
  • Union Pacific/West: 7 out of 18 (39%)

I have a lot more work to do for sure, but I’m getting there. I’ve got one line fully complete, only one station left on the Heritage Corridor, and four lines above halfway done. I also have photographed all of the stations on the South Shore Line, but will need to go back out there once Double Track is done to photograph the newer stations, and also once West Lake opens. Some of the stations are in Chicago city limits or inner suburbs and will allow me to walk between them, but some will require a combination of taking trains and walking. I’m not sure how I’ll get the stations on the North Central Service, but I’m sure I’ll make it work.

Here are a few photos I’ve gotten so far:

Outbound platform at Elgin - National Street, looking north
Elgin – National Street
Outbound platform at Hanover Park, looking west
Hanover Park
Platform at Fox Lake, looking west
Fox Lake
Southbound local track at Museum Campus/11th Street Station
11th Street/Museum Campus
Inbound platform at 107th Street - Beverly Hills, looking north
107th Street – Beverly Hills
Inbound Northwest Line platform at Clybourn
Clybourn
Platform at Manhattan, looking north
Manhattan
Platform at McCormick Place, looking north
McCormick Place
Tracks at Wheaton, looking west
Wheaton
Inbound platform at Summit, looking northeast
Summit

A trip to San Francisco, the Central Subway, and some other random photos

I traveled to San Francisco last week to meet up with some friends, and of course in the process took some photos of the new Muni Central Subway.

Formerly the T Third Street line after passing 4th and King continued along the Embarcadero and descended into a portal near Howard Street, continuing along the Market Street Subway and switching over to the K Ingleside. After the opening of the Central Subway, it now instead continues along 4th Street and descends into a tunnel at Bryant Street, continuing under 4th Street until crossing Market Street, then bends slightly north and continues under Stockton Street until reaching Washington Street and terminating there. Four new stations were built, one above-ground and three underground, with one station being a transfer to the Market Street Subway (both the other Muni Metro lines and BART) at Powell Street.

Actually getting these photos was an adventure since it was raining on and off the whole time, but I was able to get enough gaps in the rain at times I was able to get out with my camera to get the pictures I wanted. It also helped that a lot of the platforms were underground.

4th/Brannan looked pretty similar to the other above-ground stations on the T Third line with a high-level island platform in the street median with a ramp up at one end.

4th and Brannan from the west
Platform at 4th/Brannan

The underground stations were all very deep, starting with Yerba Buena/Moscone.

Entrance at Yerba Buena/Moscone
Entrance at Yerba Buena/Moscone
Southbound track at Yerba Buena/Moscone
Platform at Yerba Buena/Moscone

The line then interchanged with the Market Street Subway (including the other Muni Metro lines and BART) at Union Square (known as Powell on the other lines). They added some new entrances since this added a new (roughly) north-south platform in addition to the northeast-southwest one already there. The photo of the entrance was one of the only moments of sunlight I got on this trip.

Central Subway entrance at Union Square
New entrance in Union Square
Central Subway mezzanine at Union Square
Mezzanine above the Central Subway platform at Union Square (the Market Street Subway is at the end behind where I’m standing)
Northbound Central Subway platform at Union Square
Central Subway platform at Union Square

It’s also worth noting how long the escalator ride down is, since it has to tunnel under both the Muni Metro and BART tracks:

Central Subway escalator at Union Square
Escalator down to the platform at Union Square

Finally the line continued a few more blocks under Stockton Street, ending at Chinatown – Rose Pak.

Entrance at Chinatown - Rose Pak
Entrance at Chinatown – Rose Pak
Platform at Chinatown - Rose Pak
Platform at Chinatown – Rose Pak

Ridership on the new extension has apparently not been great, largely due to the fact that it isn’t that well connected with other bus and rail lines and it doesn’t actually go all that far. However, there are a number of proposals to extend the line further into the northwest part of San Francisco which currently doesn’t have any rail service. There were once proposals to run BART along Geary, but unfortunately none of those came to fruition. This subway could be the first step towards filling that gap and bringing rail to northeast San Francisco.

The architecture of the underground stations is pretty nice in my opinion. It’s definitely a lot more modern and impressive than a lot of the older systems, like what we have back in Chicago. I like that the stations are more open and pretty brightly lit, and the platforms are shiny compared to the dull concrete we have in Chicago. I hope that in the years to come they are well maintained and keep this appearance. Some of the older BART stations, like Embarcadero shown below, still maintain the bright and shiny appearance, so I have hope.

BART platform at Embarcadero
Platform at Embarcadero (taken in 2018)

In addition to the Central Subway project, the other big rail project in San Francisco right now is the electrification of Caltrain, the peninsula commuter rail line. I was able to take some photos of the new catenary system at San Bruno:

Platform at San Bruno Caltrain
New overhead catenary at San Bruno

From their website, it looks like they hope to have electrification complete by the second half of this year, and electric passenger service starting second half of next year. This is exciting, and I hope that other commuter rail systems in the US consider electrifying as well.

I also got a bunch of other photos, but want to focus on one other. In 2017/2018 (the week around New Years), I was on the J Church and passed Mission Dolores Park. I noticed that there was a really good view of the skyline from that station, so I hopped off and got a picture:

San Franciso skyline from Mission Dolores Park
San Francisco skyline from Mission Dolores Park in 2018

I liked how that picture came out, so I returned that evening for a nighttime picture:

San Francisco nighttime skyline from Mission Dolores Park
San Francisco nighttime skyline from Mission Dolores Park in 2018

I was a little less satisfied with that picture. Due to a combination of a camera that wasn’t great for long distance night shots and my lack of skill with it, it didn’t come out as well as I wanted it to. When we decided we were going to San Francisco, I made plans to get a redo of that shot, and as luck would have it the first night we had enough of a break in the rain to make it happen:

San Francisco nighttime skyline from Mission Dolores Park
San Francisco nighttime skyline from Mission Dolores Park in 2023

All things considered, I’m pretty satisfied with how that one turned out. It only took five years to get a chance to redo that shot, but I came back better than ever with a better camera and more knowledge on how to use it properly.

Another less dramatic change was the introduction of the new BART fleet. While the old trains are pretty worn out after their decades of service, the new ones are super sleek.

Two trains at SFO Airport
Old train on the left with a new train on the right
Northbound train at San Leandro
New train
BART D Car interior
New train interior

The new trains have a much more modern look to them, and they were quieter than the old ones too as an added bonus.

It was of course great reconnecting with friends, and it was great to see San Francisco again. I’m sure I’ll find myself there again someday.

CTA Holiday Train 2022

It’s that wonderful time of year, where the Chicago L runs the Holiday Train! I was able to catch it on the Green Line (and apparently the Orange Line). I caught it heading west/south on the Green Line towards Cottage Grove:

CTA 2022 Holiday Train at Kedzie (Green)
At Kedzie

Inside, it was decked out for Christmas:

CTA 2022 Holiday Train interior
Inside the Holiday Train

We then headed down to Cottage Grove, where I got some exterior pictures as they turned the train around:

CTA 2022 Holiday Train at Cottage Grove
Back of the Holiday Train at Cottage Grove
CTA 2022 Holiday Train at Cottage Grove
Santa flatcar

The train then headed back towards downtown, but then at Roosevelt they announced that instead of continuing back towards Harlem/Lake it would turn into an Orange Line train, running around the loop then heading out towards Midway. That was an unexpected twist of events.

CTA 2022 Holiday Train at Midway
At Midway
CTA 2022 Holiday Train at Midway
At Midway
CTA 2022 Holiday Train at Midway
Santa flatcar at Midway

At Midway, the train sat on the yard platform for a while, then was moved into the yard to end its run for the day.

It’s always nice to see some Christmas spirit on the CTA. It’s also a nice touch for something so many of us rely on every day. Christmas season has begun.

CTA 75th Anniversary

On October 1, 1947, the Chicago Transit Authority was formed, taking over operations for city buses, streetcars, and rapid transit lines. Today marks the 75th anniversary, and to mark that occasion, they ran several old railcars and buses in the Loop today.

First, I got to Daley Plaza around 8:45am so I could get a ticket on the first train. Not only did I get a ticket, I also scored a 75th anniversary pin and two awesome posters. The main boarding location was Clark/Lake, and the first railcar to arrive was a 4000 series train:

CTA 4272 at Clark/Lake
CTA 4272 at Clark/Lake

Then came the train I was booked on, a 6000 series:

CTA 6711 approaching Clark/Lake
CTA 6712, approaching Clark/Lake

I then got to take a ride around the Loop in that car:

CTA 6712 interior
Interior of CTA 6712

After that, I was able to ride on a 2400 series train:

CTA 2455 arriving at Clark/Lake
CTA 2455 arriving at Clark/Lake

I took that train around the Loop as well. The 2400 series felt a lot more familiar, not being all that different (at least from a passenger point of view) from the 2600 and 3200 series we still use today.

CTA 2489 interior
CTA 2489 interior

After returning to Clark/Lake a second time, I photographed trains from the other platform:

CTA 4271 at Clark/Lake
CTA 4271 at Clark/Lake
CTA 6711 at Clark/Lake
CTA 6711 at Clark/Lake

I then finally was able to catch a ride on the 4000 series train:

CTA 4000 series interior
CTA 4000 series interior

I then returned to Clark/Lake yet again and photographed the 2400 series train and the 4000 series train together:

CTA 4271 and 2490 at Clark/Lake
2400 series and 4000 series trains together at Clark/Lake

Then I headed over to Quincy to photograph the historic trains in the context of the one station that has retained its historic appearance.

CTA 2490 at Quincy
CTA 2490 at Quincy
CTA 4271 at Quincy
CTA 4271 at Quincy
CTA 6711 at Quincy
CTA 6711 at Quincy

Then, I rounded out the day taking an old bus, GMC 301, around downtown from Daley Plaza:

CTA bus 301 at Washington/Clark
CTA 301 at Daley Plaza

They also had bus 3706 on static display in Daley Plaza:

CTA bus 3706 at Daley Plaza
CTA 3706 in Daley Plaza

All in all cool to see. It’s a reminder of everything that it took to get us to where we are now. We are now awaiting the 7000 series L cars which will result in the retirement of the 2600 and 3200 series, and I guess that means the next time they do an event like this those will be part of their heritage fleet. Here’s to another 75 years of the CTA.

The end of the Scarborough RT

I recently had the good fortune of being able to take a vacation to Toronto. The chief reason I took this trip when I did was because Line 3 of the Toronto Subway, also known as the Scarborough RT, is closing soon.

For some context, here is a map of the Toronto Subway as of the time I post this:

Toronto Subway map (from TTC)

Line 3 is that short blue one way off to the east. It serves Scarborough, a suburban part of Toronto, Unlike Lines 1, 2, and 4, which run conventional rapid transit equipment mostly underground, Line 3 runs smaller automated railcars powered by linear induction motors and is fully above-ground. The idea was that since Scarborough was a lower-density area than most of the rest of the Toronto Subway service area, they would use a somewhat “lighter” technology that cost less to operate and maintain.

The route is only six stations over four miles, and is entirely suburban, requiring a connection at Kennedy to reach downtown Toronto. Additionally, the ridership is very low compared to the rest of the system, with only one station besides Kennedy (Scarborough Centre) ranking better than 40th out of 75 among subway stations.

Owing to the fact that the line currently has fairly low ridership, operates different technology than the rest of the subway, and the fixed infrastructure and rolling stock are old enough that they all would need to be majorly overhauled or replaced entirely, the government of Ontario has decided to replace it with an extension of Line 2. The extended Line 2 would cut farther east to a more residential area instead of the current industrial corridor seen between Ellesmere and Kennedy.

I wanted to see what was there before it’s lost to time, so here’s what I found:

Line 3 Scarborough train interior
Interior of a train
Line 3 train departing Kennedy
Train departing Kennedy
Line 3 train at Kennedy
Train at Kennedy

The design of the stations definitely looked pretty dated. There hasn’t been much change since they opened in 1985, and you can definitely see that in their design. I also was delayed because of mechanical problems at Kennedy, reflective of the issues the line faces right now.

Outbound platform at Scarborough Centre
Scarborough Centre
Entrance at Scarborough Centre
Entrance at Scarborough Centre

Scarborough Centre was definitely the most active part of the line. I actually saw a good number of people getting on here. It’s right next to the Scarborough Town Centre shopping mall, and also has a number of connections with TTC and GO buses. This is the only station (other than Kennedy) that will be served in approximately the same location by the Line 2 extension.

Entrance at Ellesmere
Entrance at Ellesmere
Ellesmere external view
Other entrance at Ellesmere
Outbound platform at Ellesmere
Platform at Ellesmere

Ellesmere is the lowest ridership station in the entire Toronto Subway system, and I could see why. It’s pretty isolated, and it doesn’t even directly connect with Ellesmere Road (which bypasses the station on the overpass). There really isn’t anything around the station.

Inbound platform at Lawrence East
Platform at Lawrence East
Entrance at Lawrence East
Entrance at Lawrence East

Lawrence East also felt somewhat isolated, but not as bad as Ellesmere. It helps that it has a bus connection on Lawrence.

McCowan external view
McCowan
McCowan external view
McCowan
Platform at McCowan
Platform at McCowan

I’m surprised McCowan doesn’t have higher ridership numbers, given that it’s located in what looks to be a reasonably high density area with several bus connections. I guess this can be attributed partly to its proximity to Scarborough Centre.

Midland station structure from ground level
Entrance at Midland
Inbound platform at Midland
Platform at Midland

Midland, on the other hand, doesn’t surprise me it has low ridership (second lowest in the entire system after Ellesmere). It only has one bus connection and appears to be in a fairly low density area without any major housing or employment centers or other destinations nearby.

With all this, it makes sense why they’re replacing this with an extension of Line 2 and rerouting it. The current train mainly just serves commuters from the Scarborough Centre area heading to Kennedy, and they have to make a transfer there, while a Line 2 extension would eliminate that transfer. The rerouting will also hopefully attract more passengers by going through a residential area instead of an industrial one. Of course avoiding having one short line that’s incompatible with the rest of the system (increasing maintenance costs and adding operational complexity) will also be a good thing. However, it is a shame that the residents of Scarborough will have to go roughly seven years without rail service between when Line 3 closes and the Line 2 extension opens.

Loading a list of products with GraphQL in BigCommerce widgets

Before we begin, the completed solution is available on GitHub.

BigCommerce offers the ability to create reusable components in the page builder called “widgets”. It comes with a few out of the box but also comes with the ability to create your own. They can be created either by pushing them directly via their API or using their widget builder. For the purposes of this demo, I did everything in widget builder.

One of the features BigCommerce offers is the ability to define custom “schema” for widgets, which is a fancy way to say options that can be edited for each instance of the widget. They can be simple, like the title and background image to use for a banner, but can also get more complex and include things like arrays of properties. One notable type is the “product ID” type, which presents itself to your widget as the ID of a product but in the admin panel is a tool that lets you search products in your store, making it very easy to insert a product teaser or something like that.

Additionally, to fetch data from the store, you can include GraphQL in your widget. The GraphQL query will use data supplied from the admin panel (with the structure defined by the schema) and provide the necessary data for the template. For example specific example, you can include a product ID selector in the admin panel then use GraphQL to get the name, image, link, etc. for the product. BigCommerce provides an example of how to do that.

However, one thing they do not seem to document is how to make the same thing work for multiple products. Sure, you could just define a bunch of separate individual products, but that’s going to get really obnoxious to work with and maintain. One alternative is use an array of products, which is better, but it turns out there’s an even better way to do it: product set.

First, we need to define our schema. In widget builder, create the following schema.json file:

[
	{
		"type": "tab",
		"label": "Content",
		"sections": [
			{
				"label": "Products",
				"settings": [
					{
						"type": "productSet",
						"label": "Product Set",
						"id": "product",
						"entryLabel": "Product",
						"default": {
							"type": "manual",
							"value": []
						}
					}
				],
				"typeMeta": {
					"type": "setSection"
				}
			}
		]
	}
]

This defines an attribute of type “productSet” (i.e. a list of products”) with the ID “product”.

Next, we need to pass the values from that selection into GraphQL. We can further edit the schema and add another element of type “graphQl” that specifies the mapping from schema parameters to GraphQL parameters. We do that in the text highlighted below.

[
	{
		"type": "hidden",
		"settings": [
			{
				"type": "graphQl",
				"id": "graphQueries",
				"typeMeta": {
					"mappings": {
						"productIds": {
							"reads": "product.value.*.productId",
							"type": "Int!"
						}
					}
				}
			}
		]
	},
	{
		"type": "tab",
		"label": "Content",
		"sections": [
			{
				"label": "Products",
				"settings": [
					{
						"type": "productSet",
						"label": "Product Set",
						"id": "product",
						"entryLabel": "Product",
						"default": {
							"type": "manual",
							"value": []
						}
					}
				],
				"typeMeta": {
					"type": "setSection"
				}
			}
		]
	}
]

Next, we need to write the GraphQL query. To do that, create the file query.graphql:

query productsById($productIds: [Int!]) { 
  site { 
    products(entityIds: $productIds) { 
      edges {
        node {
          entityId
          sku
          name
          path
        }
      }
    } 
  } 
}

This query looks up the ID, SKU, URL path, and name of each product for any product in the $productIds parameter (which we passed in via GraphQL mapping). Important to note here is the type: $productIds is an array of non-nullable ints ([Int!]), while in the mapping, we specified the type for each individual element to be a non-nullable int (Int!), which was automatically aggregated to be an array by the widget utility.

Finally, we can actually use this data in the template. In this very limited example, you can see a list of the product names by creating widget.html with the following content:

{{#each _.data.site.products.edges}}
<h3><a href="{{node.path}}">{{node.name}}</a></h3>
<div>SKU: {{node.sku}}</div>
{{/each}}

With that, we have rendered a list of products! See the final result below.

The final result