Hello OpenGeek,
The snippet seems having some trouble with tpl options in snippet call.
Calling of my custom templates is below (chunks based)
&pageFirstTpl=`getPageFirstTpl`
&pageLastTpl=`getPageLastTpl`
&pagePrevTpl=`getPagePrevTpl`
&pageNextTpl=`getPageNextTpl`
And each chunk contains only the HTML of the snippet code, without any PHP escaping slashes.
The output is only giving the chunks names.
See testing website.
Seems the following function of the package doesn’t do its job correctly with chunks.
It works well with direct HTML inside the snippet call - but not very usefull for every day coding practise.
function getpage_makeUrl(& $modx, $properties, $pageNo, $tpl) {
$qs = $properties['qs'];
$qs[$properties['pageVarKey']] = $pageNo;
$properties['href'] = $modx->makeUrl($modx->resource->get('id'), '', $qs);
$properties['pageNo'] = $pageNo;
$nav= $modx->newObject('modChunk')->process($properties, $tpl);
return $nav;
}
[Edit]
I’ve found a workaround until you have found why it doesn’t do chunk processing, but I don’t know if it is really the good way of doing this...
$properties['pageFirstTpl'] = empty($pageFirstTpl) ? "<li class=\"control\"><a[[+title]] href=\"[[+href]]\">First</a></li>" : $modx->getChunk($pageFirstTpl);
$properties['pageLastTpl'] = empty($pageLastTpl) ? "<li class=\"control\"><a[[+title]] href=\"[[+href]]\">Last</a></li>" : $modx->getChunk($pageLastTpl);
$properties['pagePrevTpl'] = empty($pagePrevTpl) ? "<li class=\"control\"><a[[+title]] href=\"[[+href]]\"><<</a></li>" : $modx->getChunk($pagePrevTpl);
$properties['pageNextTpl'] = empty($pageNextTpl) ? "<li class=\"control\"><a[[+title]] href=\"[[+href]]\">>></a></li>" : $modx->getChunk($pageNextTpl);
Have a good day!
Terry.