diff --git a/formats/widget/SRF_ListWidget.php b/formats/widget/SRF_ListWidget.php index b0af4ebd5..edf7f3c68 100644 --- a/formats/widget/SRF_ListWidget.php +++ b/formats/widget/SRF_ListWidget.php @@ -37,13 +37,14 @@ public function getName() { protected function getResultText( QueryResult $res, $outputmode ) { // Initialize static $statNr = 0; - // $this->isHTML = true; + $this->hasTemplates = ( $this->params['template'] !== '' ); $listType = $this->params[ 'listtype' ] === 'ordered' || $this->params[ 'listtype' ] === 'ol' ? 'ol' : 'ul'; $builder = new ListResultBuilder( $res, $this->mLinker ); $builder->set( $this->params ); + $builder->set( [ 'format' => $listType, 'link-first' => $this->mLinkFirst, @@ -51,6 +52,12 @@ protected function getResultText( QueryResult $res, $outputmode ) { 'show-headers' => $this->mShowHeaders, ] ); + // this does not work, it would be preferable + // to find a way to disable links when template is used + // if ( $this->hasTemplates ) { + // $builder->set( [ 'link' => 'none' ] ); + // } + // Get results from \SMW\Query\ResultPrinters\ListResultPrinter $result = $builder->getResultText(); @@ -127,6 +134,10 @@ public function getParamDefinitions( array $definitions ) { 'default' => 5, ]; + $params['template'] = [ + 'message' => 'smw-paramdesc-template', + 'default' => '', + ]; return $params; } }