Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Views Pretty Paths

22 sites Security covered Drupal 8–11 Views ecosystem
View on drupal.org

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.

Depends on

Dependencies of the latest stable release

  • path_alias Drupal core
  • redirect Drupal core
  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Nov 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Slowing

Releases

Version Type Core Release date
1.0.3 Stable 8–11 Jun 12, 2025
1.0.2 Stable 8–10 Nov 4, 2024