[TYPO3] indexed_search metatags search replacing space

Andreas Jonderko anj2j at yahoo.de
Thu Aug 17 17:08:16 CEST 2006


The solution for this is to add a whitespace after the metatags 
generator removed it:

Edit the file:
typo3/sysext/indexed_search/indexer.php

Add this function which adds a whitespace after a comma (,):

	/**
	 * Add whitespaces after every pattern
	 *
	 * @param	string		String to add whitespace
	 * @param	string		Pattern after the whitespace shoud be added
	 * @return	string		String with whitespaces
	 */
	function addWhiteSpace($string,$pattern) {
		$temp = split($pattern,$string);
		$toReturn = "";
		foreach ($temp as $word)  {$toReturn .= $word.$pattern." ";}
		return $toReturn;
	}

<b>Before the lines:</b>

$contentArr['keywords'] = trim($contentArr['keywords']);
$contentArr['description'] = trim($contentArr['description']);

Add the 2 lines:

// adding whiteSpace after every keyword
$contentArr["keywords"] = $this->addWhiteSpace($contentArr["keywords"],",");
$contentArr["description"] = 
$this->addWhiteSpace($contentArr["description"],",");

Best Regards!
Andreas Jonderko
pixelmotor.de



Andreas Jonderko schrieb:
> Hi typo3 friends!
> 
> Im using indexed_search and have problems to fit the settings.
> The problem is that the metatags, seperated by a comma (,) and a space 
> (like: keyword1, keyword2, keyword3 and so on) are wrapped together to 
> one very long word -> keyword1,keyword2,keyword3 and so on ...
> 
> 
> The resulting page is giving this one line out and through this the 
> wrapping is not possible. So the result is very ugly. I don't want to 
> change the php files, so I ask you how to fit the settings _not_ to 
> remove the space in the metatags?
> 
> Best regards
> Andreas Jonderko



More information about the TYPO3-english mailing list