Automatically Generate URL Aliases from Menu Structure using Pathauto in Drupal

Опубликовано: 23 Июль 2024
на канале: WebWash
172
7

Pathauto module in Drupal allows you to generate URL aliases that follow the menu structure.

Let's say, for example, you have the following structure:

Top level (/top-level)
- First level (/top-level/first-level)
- - Second level (/top-level/first-level/second-level)

Pathauto can be configured to get the parent URL automatically.

This approach creates more intuitive and organized URLs for your website.

Implementation steps:

1️⃣ Install the Pathauto module

2️⃣ Navigate to Configuration URL aliases Patterns

3️⃣ Add a new Pathauto pattern

4️⃣ Use the token: [node:menu-link:parent:url:path]/[node:title]

5️⃣ Select the appropriate content type

6️⃣ Save the pattern

Key benefits:

➜ Automatically generates URL aliases based on menu hierarchy

➜ Improves site navigation and SEO

➜ Saves time on manual URL management

This token combination ensures that child pages inherit their parent's URL structure, maintaining a logical hierarchy throughout your site.

Remember to regenerate aliases for existing content after implementing this pattern.

Note: To change the path on a top-level page, you must regenerate all the paths again.

#drupal #seo #drupalseo

~~~
If you found this post helpful.

♻️ Please repost and follow.

📧 Join our newsletter; link in the first comment.


Смотрите видео Automatically Generate URL Aliases from Menu Structure using Pathauto in Drupal онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь WebWash 23 Июль 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 17 раз и оно понравилось людям.