I am trying to get a substring but I get a Failed to execute the [velocity] macro
. I have no idea why this is happening. Here is my code:
#if ($text != '' )
#set ($textwo = "${text.substring(0,4)}")
if($textwo != "Tags" )
#getSearchResults()
(% class="search-results-container" %)(((
#displaySearchFacets($searchResponse)
(% class="search-results-left" %)(((
#displaySearchResultsSort()
#displaySearchResults()
)))
)))
#end
#if ($textwo == 'Tags')
#getTaggedResult
#end
#end
If I remove the line #set ($textwo = "${text.substring(0,4)}")
, I dont get the error anymore and ofcourse it does not work.