 facetapi_bonus.page_title.inc | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/facetapi_bonus.page_title.inc b/facetapi_bonus.page_title.inc
index 6d2a818..55f7111 100644
--- a/facetapi_bonus.page_title.inc
+++ b/facetapi_bonus.page_title.inc
@@ -15,7 +15,31 @@ function facetapi_bonus_page_title_pattern_alter(&$pattern, &$types) {
     $searcher = reset($searchers);
     $adapter = facetapi_adapter_load($searcher);
 
-    $types['facetapi_results'] = array('facetapi_adapter' => $adapter);
+    // Provide explicit information for $data for the key facetapi_results
+    // replacements. This could be avoided if facetapi_tokens could provide
+    // default explicit values based on facetapi_get_active_searchers.
+    if (strpos($pattern, 'facetapi_results') !== FALSE) {
+      $types['facetapi_results'] = array('facetapi_adapter' => $adapter);
+    }
+
+    // Provide explicit information for $data for the key facetapi_active_item
+    // if any facetapi_active_item not wrapped in list<...> is found
+    if (preg_match_all('/[^list<]\[facetapi_active:[^>]/', $pattern, $matches)>0) {
+      // Select the item that was added last (so the most recently added filter).
+      if ($item = end($adapter->getAllActiveItems())) {
+        $item['adapter'] = $adapter;
+        $types['facetapi_active_item'] = $item;
+      }
+    }
+
+    // Provide explicit information for $data for the key facetapi_facet
+    if (strpos($pattern, 'facetapi_facet') !== FALSE) {
+      // Select the item that was added last (so the most recently added filter).
+      if ($item = end($adapter->getAllActiveItems())) {
+        $facet_name = $item['facets'][0];
+        $types['facetapi_facet'] = facetapi_facet_load($facet_name, $searcher);
+      }
+    }
 
     // If we meet list<...[facetapi_active:XXX]...> string we replace it with
     // coma separated list of tokenized string.
