Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Views Current Path

Views Current Path provides a Views field that prints the current path, or part of the current path, of the current page. It has options for system or alias paths, relative and absolute paths, just the query string or just the base url.

If using the relative alias path, then you also have options for how to handle query strings including adding additional query strings or removing the query strings altogether.

IMPORTANT: Within the View configuration Preview, you will only see placeholders (e.g. [current_path]). You will need to save the View and look at the Page or block to see the result.

Differences from Drupal 7

A "domain only" option was added as an Output style as it was trivial to add and provides greater flexibility.

Installation

Usage

  1. Create/edit your view and click to add a new field.
  2. In the "Add fields" window, choose "Global: Current Path".
  3. Configure the field options and apply it to your display.

Although there are many use-cases for this functionality, the most common use is taking advantage of the "Rewrite results" section in other fields where you can use this field token (i.e. [current_path]) in the text or adding it to the "Output this field as a link" input box.

It is possible to add multiple instances of this field to a View so you can compile URLs to meet your needs. If you do this, it is recommended that you set an Administrative title under the More tab at the bottom of the Configure Field dialog.

An example of usage can be found in Views Fix 404 Pages Filter Recipe.

Issues

Bugs and Feature Requests should be reported in the Issue Queue: https://github.com/backdrop-contrib/views_current_path/issues.

Current Maintainers

Credits

License

This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.

About

Defines a views field that prints the path, or parts of the path, of the page currently being viewed on your Backdrop CMS website

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages