This is an old revision of the document! Custom search result
Edit function islandora_solr_custom_preprocess_islandora_solr_custom(&$variables) { ... if ($field=="PID") { $hlv = $hl->$value; foreach ($hlv as $singlef) { $linee = ""; foreach ($singlef as $linea) { $linee = $linee."... ".$linea."... <br>"; } $resultsArray['OCR.OCR']['value'] = $linee; } } Tip if (($field=="dc.description")&&($value!="")) { $resultsArray[$field]['value'] = substr($value,0,200)."... "; } // set the fields $resultsArray[$field]['label'] = $db_value['label']; $resultsArray[$field]['class'] = strtolower( preg_replace('/[^A-Za-z0-9]/', '-', $db_value['field$ $resultsArray[$field]['exclude_label'] = $db_value['exclude_label']; $resultsArray[$field]['markup'] = $db_value['markup']; } ...
Edit Tip <?php// print $switch_rendered; ?> <?php $style = 'table'; ?> <?php if ($style == 'div'): ?> <?php elseif ($style == 'table'): ?> <?php// print $table_rendered; ?> <?php if ($results == ''): print '<p>' . t('Your search yielded no results') . '</p>'; ?> <?php else: ?> <table class="islandora_solr_results"> <?php foreach ($results as $id => $result): ?> <?php $modello = $result['rels.hasModel']['value']; ?> <?php if ($modello == "info:fedora/islandora:pageCModel"):?> <tr class="islandora_solr_result"> <td class="label" rowspan="2"> <?php print "<a href=\"".base_path()."fedora/repository/".substr($result['PID']['value'],0,-5)."\"><img src=\"".base_path()."fedora/repository/".substr($result['PID']['value'], 0, -5)."/TN\"></img></a>"; ?> </td> <td class="value"> <?php print "<b>".substr($result['dc.title']['value'],0,-12)."</b>"; ?><br><br> <i><?php print $result['dc.creator']['value']; ?></i><br> <i><?php print $result['dc.publisher']['value']; ?></i><br> <i><?php print $result['dc.description']['value']; ?></i><br> </td> <td class="plabel" rowspan="2"> <?php print "<a href=\"".base_path()."fedora/repository/".$result['PID']['value']."\"><img height=\"150\" src=\"".base_path()."fedora/repository/".$result['PID']['value']."/TN\"></img></a>"; ?> <?php print "<br><b>".substr($result['dc.title']['value'],-9)."</b>"; ?> </td> </tr> <tr class="islandora_solr_result"> <td class="ocrvalue"> <?php print $result['OCR.OCR']['value']; ?> </td> </tr> <?php elseif ($modello == "info:fedora/islandora:bookCModel"): ?> <tr class="islandora_solr_result"> <td class="label"> <?php print "<a href=\"".base_path()."fedora/repository/".$result['PID']['value']."\"><img src=\"".base_path()."fedora/repository/".$result['PID']['value']."/TN\"></img></a>"; ?> </td> <td class="value"> <?php print "<b>".$result['dc.title']['value']."</b>"; ?><br><br> <i><?php print $result['dc.creator']['value']; ?></i><br> <i><?php print $result['dc.publisher']['value']; ?></i><br> <i><?php print $result['dc.description']['value']; ?></i><br> </td> </tr> <?php endif; ?> <?php endforeach; ?> </table> <?php endif; ?> <?php endif; ?>
Edit Tip /* css markup for template */ .islandora_solr_result { margin-bottom: 25px; border: 10px solid #fff; background: #fff url(images/bg-content.png) repeat-x 50% 0; } .islandora_solr_result .label { width: 180px; padding: 10px 10px 0px 0px; vertical-align: top; text-align: right; background: #fff; } .islandora_solr_result .plabel { width: 110px; padding: 0px 0px 0px 5px; vertical-align: bottom; text-align: left; } .islandora_solr_result .value { padding: 10px 0px 0px 2px; vertical-align: top; text-align: left; } .islandora_solr_result .ocrvalue { padding: 0px 5px 0px 5px; vertical-align: top; text-align: right; font-size:0.82em; background: #fff; }
Copy |