Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Added missing extractTextFromNeo Twig filters/functions #301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions twigextensions/SeomaticTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
);
Expand All @@ -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'),
);
Expand Down Expand Up @@ -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
-------------------------------------------------------------------------------- */
Expand Down