Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Views Pretty Paths

Security covered Under active development 20 sites

Part of the Views ecosystem · 280 projects

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.

Drupal 8–11

Ask your assistant about Views Pretty Paths

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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
4
Tracked since
Jan 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
1.0.3 Stable 8–11 Jun 12, 2025
1.0.2 Stable 8–10 Nov 4, 2024
1.0.1 Stable 8–10 Jan 2, 2024
1.0.x-dev Dev 10–11 Jan 2, 2024