Thanks Guys, I'll be looking into Uploadify except for I just noticed the data objects aren't searchable.
Since the staff section is an important part of the site it has to be searchable. Anybody know of a way to make that happen?
I've tried Lucene search and Sphinx but their set up is quite complicated and over my head, can't get either working.
If I can't get this figured out I may just have to forget it and go back to creating individual pages for a few lines of text... pity :(
Duh! Sorry, I didn't see that that post had 2 more pages.
Okay, making some progress now. It finds the relevant info but in the search results the Found in: and Read more about ""... don't display the name of the page. The links work but it just doesn't display the name of the page. Any idea on what I've done to cause that?
Heres the current code:
// Start Custom
$arrSearchQuery = explode(' ',$form->getSearchQuery());
$strSearchQuery = '%'.implode('%',$arrSearchQuery).'%';
$dos = DataObject::get('StaffMember',"(ChamberTitle LIKE '".$strSearchQuery."'"."OR Name LIKE '".$strSearchQuery."'"."OR Business LIKE '".$strSearchQuery."'"."OR Phone LIKE '".$strSearchQuery."'"."OR Email LIKE '".$strSearchQuery."') " );
//make our our result set
$dosNewResults = new DataObjectSet();
$arr = $dos->toArray();
foreach ($arr as $do)
$p = new Page();
$p->ChamberTitle = $do->ChamberTitle;
$p->URLSegment = '/your-chamber/Staff-members/';;
$p->Content = $do->Description;;
$p->Name = $do->Name;;
$p->Business = $do->Business;;
$p->Phone = $do->Phone;;
$p->Email = $do->Email;;
// $p->SearchTerm = $do->SearchTerm;;
$p->ID = $do->ID;;
$p->Relevance = 1;
$p->CanViewType = 'Anyone';
foreach ($arrSearchQuery as $strSearchQuery)
$strSearchQuery = '%'.$strSearchQuery.'%';
//repeat code to do DataOBject::get
//add to $dosNewResults
//strip out the html from the results and append them to the results
//above - so that the ones with things to buy are first
if ($data['Results']->Count() > 0)
$arr = $data['Results']->toArray();
foreach ($arr as $do)
$do->Content = strip_tags($do->Content);
$data['Results'] = $dosNewResults;
// End Custom
return $this->customise($data)->renderWith(array('Page_results', 'Page'));