From b739be4a7cae7d4dca5fea0a1b48f1acaa24ae25 Mon Sep 17 00:00:00 2001 From: Dennis Frank Date: Mon, 4 Dec 2017 00:39:42 +0100 Subject: [PATCH] Added missing extractTextFromNeo Twig filters/functions --- twigextensions/SeomaticTwigExtension.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/twigextensions/SeomaticTwigExtension.php b/twigextensions/SeomaticTwigExtension.php index bff49af..43d2224 100755 --- a/twigextensions/SeomaticTwigExtension.php +++ b/twigextensions/SeomaticTwigExtension.php @@ -56,6 +56,7 @@ public function getFilters() 'truncateStringOnWord' => new \Twig_Filter_Method($this, 'truncateStringOnWord'), 'encodeEmailAddress' => new \Twig_Filter_Method($this, 'encodeEmailAddress'), 'extractTextFromMatrix' => new \Twig_Filter_Method($this, 'extractTextFromMatrix'), + 'extractTextFromNeo' => new \Twig_Filter_Method($this, 'extractTextFromNeo'), 'getLocalizedUrls' => new \Twig_Filter_Method($this, 'getLocalizedUrls'), 'getFullyQualifiedUrl' => new \Twig_Filter_Method($this, 'getFullyQualifiedUrl'), ); @@ -74,6 +75,7 @@ public function getFunctions() 'truncateStringOnWord' => new \Twig_Function_Method($this, 'truncateStringOnWord'), 'encodeEmailAddress' => new \Twig_Function_Method($this, 'encodeEmailAddress'), 'extractTextFromMatrix' => new \Twig_Function_Method($this, 'extractTextFromMatrix'), + 'extractTextFromNeo' => new \Twig_Function_Method($this, 'extractTextFromNeo'), 'getLocalizedUrls' => new \Twig_Function_Method($this, 'getLocalizedUrls'), 'getFullyQualifiedUrl' => new \Twig_Function_Method($this, 'getFullyQualifiedUrl'), ); @@ -178,6 +180,17 @@ public function extractTextFromMatrix($matrixBlocks) return $result; } /* -- extractTextFromMatrix */ +/* -------------------------------------------------------------------------------- + Extract all of the text and rich text from the fields in NeoBlockModels +-------------------------------------------------------------------------------- */ + + public function extractTextFromNeo($neoBlocks) + { + $result = craft()->seomatic->extractTextFromNeo($neoBlocks); + + return $result; + } /* -- extractTextFromNeo */ + /* -------------------------------------------------------------------------------- Returns an array of localized URLs for the current request -------------------------------------------------------------------------------- */