Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module transforms complex Drupal Views URLs into simpler, more SEO-friendly versions. It allows you to define custom paths and map filter identifiers to user-friendly terms.

Introduction

Views Pretty Path rewrites URLs associated with Views into into a more user- and SEO-friendly format.

For example, Views Pretty Path would take this URL:

http://example.com/blog?keys=blockchain&field_topic_target_id%5B54%5D=54&field_asset_type_target_id%5B14%5D=14

And rewrite it as:

http://example.com/blog/filter/assets/article/topics/technology/keywords/blockchain.

Requirements

No special requirements.

Recommended Modules

No recommended modules.

Installation

Configuration

The configuration form can be found at /admin/config/views-pretty-path.

Set the paths to rewrite (prepending a '/' slash), the view each path will be associated with, and the display of that view from which filters will be considered by Views Pretty Path during rewriting. Views Pretty Path will then check against this list, and if a request path matches one of the paths set in the form, query parameters will be rewritten according to the filters in the selected view.

A mapping betweeen views filter identifiers and user-defined names can also be set (e.g. 'field_topic_target_id' is rewritten as 'topics'). Use the following syntax, each rule separated by a new line: filter_identifier|name

Lastly, a filter subpath can be set (i.e. 'http://example.com/blog/filter/{term1}/{term2}' has the subpath of '/filter'). The default subpath is '/filter'.

Extending

A view may use a filter that is currently not supported by Views Pretty Path. In that case, a custom Views Pretty Path filter handler service can be created in a custom module that implements Drupal\views_pretty_paths\FilterHandlers\ViewsPrettyPathFilterHandlerInterface, extends Drupal\views_pretty_paths\FilterHandlers\AbstractFilterHandler and uses the 'views_pretty_paths_filter_handler' Symfony service tag. For an example, see views_pretty_paths.services.yml and Drupal\views_pretty_paths\FilterHandlersTextFilterHandler. Implement the getTargetedFilterPluginIds() method to select which Views filter plugin IDs to target with a custom filter handler.

Activity

Total releases
1
First release
Jun 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
1.0.3 Stable Jun 12, 2025