You are here:  » Normalize an additional field


Normalize an additional field

Submitted by xlot on Sat, 2006-11-04 05:32 in

Hey everyone,

I've played alot with tapestry and have added some additional fields for import. Every is working well except, I need to normalize some of the fields. I have tried under the includes admin.php

if ($admin_importFeed["field_add2"])
{
$record[$admin_importFeed["field_add2"]] = tapestry_categorise($record[$admin_importFeed["field_add2"]]);
$record[$admin_importFeed["field_add2"]] = tapestry_normalise($record[$admin_importFeed["field_add2"]]);
}
and added to tapestry.php

function tapestry_categorise($text)

but that does'nt seem to work,,,, anyone have any ideas were I need to mod to get it to normalize?
Thanks!

Submitted by support on Sat, 2006-11-04 08:58

Hi,

I take it you added the tapestry_categorise() function from this thread:
http://www.pricetapestry.com/node/435

Your above code looks OK. Is the field simply not being normalised, as if that code is not being executed? Where abouts did you insert it into includes/admin.php?

If it's making the field empty I would have a look at your categorise function and confirm that it is return what you expect it to return. You could try this in a test script, for example:

test.php

<?php
  
require("includes/tapestry.php");
  
$category "Test > Category";
  
$category tapestry_categorise($category);
  print 
$category;
?>

Cheers,
David.