I need some help with a problem i encountered during development of a job post website.

I have managed to generate a block ("laatste 21 vacatures") on http://www.ikarnhem.nl/new. The block is generated with help of a view.

As one can see the title of a job is with capitals and the is a space between two words, e.g. "Medewerker Hifi". I would like to display Medewerker Hifi on the website but the actual path of this link has to be:

"http://www.ikarnhem.nl/new/vacatures/medewerker-hifi"

and not

"http://www.ikarnhem.nl/new/vacatures/Medewerker Hifi".

The block is generated with help of a view.

The field i used is the title of this node. Here it comes! Is the any way to convert the title to lowercase and remove the free space into dashed. I managed to do this trough node path aliasing and a theme override for linkdisplay trough the website.

Somehow i cannot think of a solution....

Thnks in advance

Comments

suffering drupal’s picture

Posted on another issue with the same problem:
http://drupal.org/node/514078#comment-2031486

Let's hope someone can help us!

I started with Drupal in 2007 and then my life got stuck...

munmon’s picture

Create a new module and use this function:

function sitehelper_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {	
	
	switch ($op) {
	 case 'presave':
	  switch ($node->type) {
	   case 'announcements':
	   default:
	   	$stripped = preg_replace(array('/\s{2,}/', '/[\t\n]/'), ' ', $node->title);		
		$node->title = $stripped;
	  break;			
	  }
			
	break;	
	}		
}