close-up-nuts-and-bolts.jpg

Drupal Troubleshooting Tutorial

UX Content Writing

This is a how-to response to the OST Training Video: Drupal 8 Beginner, Lesson 29: Setting up URL Patterns. A lot of people are having trouble with this part of the course, so I thought I'd share my experience reaching a solution. Pathauto has changed a lot so this is going to be a different process than what's described in the video.

First, visit the link provided in the youtube video summary where it states that Pathauto has been changed: https://www.ostraining.com/blog/drupal/pathauto/

Then install all three modules: Pathauto, Ctools, and Token. Also, for the purpose of this tutorial install Admin Toolbar, it will make navigating the console a lot easier. You can either install by pasting the links, or by downloading them to your computer and then installing, which is what I had to do since pasting wasn't working for some reason. If you download them to your computer, do not unzip them! Drupal can't install them if they are unzipped. Once they are installed you can delete the zip files.

NOTE: Make sure you install the correct version of Ctools! Don't assume that whatever is in green is what you need to install! It must be compatible with Drupal v. 8 and not marked "dev" (see caption).

The correct version of Ctools for this tutorial.

The correct version of Ctools for this tutorial.

Uploading Ctools from my computer.

Uploading Ctools from my computer.

Installation by copying the link on a mac.

Installation by copying the link on a mac.

Click me!

Click me!

Once the modules are uploaded, follow the instructions in the video to install them by going to Extend > Administration and checking the boxes for the ones you just added. Make sure you click the install button at the bottom or your changes won't be saved.

Do it like this.

Do it like this.

At this point you should be good to go, but this is where most people seem to have hit a wall (I was stuck here for a while too.) If you are not seeing the additional tabs "Patterns, Settings, Bulk Generate, Delete Aliases," go back to Extend and uninstall Pathauto. Then clear the cache and cookies in your web browser, and go to Manage > Flush all caches. Close out your website browser tab, shut down Acquia Dev Desktop, then restart your computer.

 

Restart Acquia Dev Desktop and go to your site. You'll need to log back in since you cleared all your cookies. The login link is in a weird place since we haven't set up something more sophisticated yet.

login.png
add pathauto pattern.png

Once you're logged back in, go back to Extend and reinstall Pathauto. You should be seeing the "Patterns, Settings, Bulk Generate, Delete Aliases" tabs now. You may have to repeat this entire process a couple of times if it doesn't work right off the bat. Welcome to debugging.

But we're not done!

For Pathauto to work, you need to individually define each url pattern before you can use Bulk Generate. Go to Administration > Configuration > Search and Metadata > URL aliases > Patterns and click "+ Add Pathauto Pattern."

Now go through each Pattern Type and define the URL pattern. Each Path Pattern needs to follow the structure of "_________//[node:title]." I just copied what was in the youtube tutorial.

save pathauto pattern.png
youtube screenshot.png

Once all that is done NOW we can use Bulk Generate. Go to Administration > Configuration > Search and Metadata > URL Aliases > Bulk Generate. Tick all the boxes and click "Update." If you leave them unchecked, you will need to individually define the URL path for each new item you add to the website. That's why we're adding these modules to do the work for us!

bulk generate.png
voila.png

Now if you go to Add Content > Create Basic Page > URL Path Settings, you should see that the "Generate automatic URL alias" box is checked. Check it if for some reason it isn't.

Now when you publish your first article according to the video, you will see that the URL path matches the node and title aliases, just like you told it to! If you make changes to your articles, the url will automatically update itself to reflect those changes. Pretty cool!

success.png
changed title.png