From a6e5e02532e0edd97c190504f23f8dc5e2427ea2 Mon Sep 17 00:00:00 2001 From: pepebe Date: Sun, 8 Apr 2012 22:50:43 +0300 Subject: [PATCH] Add every parameter prefixed with an underscore to the placeholder array This is usefull to pass special parameters towards snippets that are called within a wayfnnder template Example: [[Wayfinder? &startId=`1` &level=`1` &_getImageListTpl=`some Tpl` ]] [[!getImageList? &docid=`[[+wf.docid]]` &tvname=`someMIGx TV` &tpl=`[[+wf._getImageListTpl]]` ]] --- core/components/wayfinder/wayfinder.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/components/wayfinder/wayfinder.class.php b/core/components/wayfinder/wayfinder.class.php index 9aebbee..91f4f19 100644 --- a/core/components/wayfinder/wayfinder.class.php +++ b/core/components/wayfinder/wayfinder.class.php @@ -334,6 +334,13 @@ public function renderRow(&$resource,$numChildren) { $placeholders['wf.subitemcount'] = $numChildren; $placeholders['wf.attributes'] = $resource['link_attributes']; + // Add every parameter prefixed with an underscore to the placeholder array + foreach ($this->_config as $key => $value){ + if( $key[0] == '_' ) { + $placeholders["wf.$key"] = $this->_config[$key]; + } + } + if (!empty($this->tvList)) { $usePlaceholders = array_merge($placeholders,$this->placeHolders['tvs']); foreach ($this->tvList as $tvName) {