diff --git a/includes/VectorTemplate.php b/includes/VectorTemplate.php index 887a9a812..0270b4057 100644 --- a/includes/VectorTemplate.php +++ b/includes/VectorTemplate.php @@ -228,45 +228,39 @@ class VectorTemplate extends BaseTemplate { if ( $msg === null ) { $msg = $name; } - $msgObj = $this->getMsg( $msg ); - $labelId = Sanitizer::escapeIdForAttribute( "p-$name-label" ); - ?> - - getMsg( $msg ); + + $props = [ + 'portal-id' => "p-$name", + 'html-tooltip' => Linker::tooltip( 'p-' . $name ), + 'msg-label' => $msgObj->exists() ? $msgObj->text() : $msg, + 'msg-label-id' => "p-$name-label", + 'html-userlangattributes' => $this->data['userlangattributes'] ?? '', + 'html-portal-content' => '', + 'html-after-portal' => $this->getAfterPortlet( $name ), + ]; + + if ( is_array( $content ) ) { + $props['html-portal-content'] .= ''; + } else { + // Allow raw HTML block to be defined by extensions + $props['html-portal-content'] = $content; + } + + echo $this->templateParser->processTemplate( 'Portal', $props ); } /** diff --git a/includes/templates/Portal.mustache b/includes/templates/Portal.mustache new file mode 100644 index 000000000..3d7cbc201 --- /dev/null +++ b/includes/templates/Portal.mustache @@ -0,0 +1,19 @@ +{{! + string portal-id + string html-tooltip + string msg-label-id + string|null html-userlangattributes + string msg-label} + string html-portal-content + string|null html-after-portal +}} + +