It would be good if we started to add more token support for core tokens. With the hope of using this more widely throughout views.

Here is an initial patch to get thing started. Adds new tokens for result count, base table, and base field.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

+++ b/lib/Drupal/views/Tests/TokenReplaceTest.phpundefined
@@ -32,6 +32,7 @@ class TokenReplaceTest extends ViewTestBase {
     $view->setDisplay('page_1');
+    $view->execute();

Better use $this->executeView($view);

A random suggestion, what about adding the total items if available?

damiankloip’s picture

FileSize
2.26 KB

Good point.

damiankloip’s picture

FileSize
3.15 KB

With a couple more tokens...

Status: Needs review » Needs work

The last submitted patch, 1817938-3.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
FileSize
3.83 KB

Forgot to add the changes to the yml file to the patch. Also, I realised if the the items per page is 0 we would set this to 1 for the division.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

This looks good now

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Automatically closed -- issue fixed for 2 weeks with no activity.