Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
frontend:searchres [2012/05/16 10:03]
giancarlo
frontend:searchres [2013/09/05 11:38]
giancarlo
Line 1: Line 1:
 ====== Custom search result ====== ====== Custom search result ======
  
-  * **Limit ''dc.description'' to 200 chars**+  * **Speed up search (from 30s to 1s !!) and Limit ''dc.description'' to 200 chars**
  
 Edit ''sites/all/modules/islandora_solr_custom/theme/islandora_solr_custom.theme.inc'' Edit ''sites/all/modules/islandora_solr_custom/theme/islandora_solr_custom.theme.inc''
Line 7: Line 7:
 <code php> <code php>
 function islandora_solr_custom_preprocess_islandora_solr_custom(&$variables) { function islandora_solr_custom_preprocess_islandora_solr_custom(&$variables) {
 +...
 +</code>
 +<wrap tip>Tip</wrap>
 +<WRAP prewrap center caution>
 +<code php>
 +//  $variables['field_order'] = _islandora_solr_custom_solrconfig(); // not sure if this is really needed, but I'll keep it in for now.
 +</code>
 +</WRAP>
 +<code php>
 ... ...
       if ($field=="PID") {       if ($field=="PID") {
Line 49: Line 58:
  
 <?php if ($style == 'div'): ?> <?php if ($style == 'div'): ?>
- 
- 
 <?php elseif ($style == 'table'): ?> <?php elseif ($style == 'table'): ?>
  
Line 62: Line 69:
    <tr class="islandora_solr_result">    <tr class="islandora_solr_result">
      <td class="label" rowspan="2">      <td class="label" rowspan="2">
-              <?php print "<img src=\"".base_path()."fedora/repository/".$result['PID']['value']."/TN\"></img>"; ?>+              <?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>
      <td class="value">      <td class="value">
-       <?php print "<a href=\"".base_path()."fedora/repository/".$result['PID']['value']."\"><b>".$result['dc.title']['value']."</b></a>"; ?><br><br>+       <?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.creator']['value']; ?></i><br>
               <i><?php print $result['dc.publisher']['value']; ?></i><br>               <i><?php print $result['dc.publisher']['value']; ?></i><br>
               <i><?php print $result['dc.description']['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>      </td>
    </tr>    </tr>
Line 79: Line 90:
           <tr class="islandora_solr_result">           <tr class="islandora_solr_result">
             <td class="label">             <td class="label">
-              <?php print "<img src=\"".base_path()."fedora/repository/".$result['PID']['value']."/TN\"></img>"; ?>+              <?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>
      <td class="value">      <td class="value">
-       <?php print "<a href=\"".base_path()."fedora/repository/".$result['PID']['value']."\"><b>".$result['dc.title']['value']."</b></a>"; ?><br><br>+       <?php print "<b>".$result['dc.title']['value']."</b>"; ?><br><br>
               <i><?php print $result['dc.creator']['value']; ?></i><br>               <i><?php print $result['dc.creator']['value']; ?></i><br>
               <i><?php print $result['dc.publisher']['value']; ?></i><br>               <i><?php print $result['dc.publisher']['value']; ?></i><br>
Line 103: Line 114:
 <code css> <code css>
 /* css markup for template */ /* css markup for template */
- 
  
 .islandora_solr_result .islandora_solr_result
 { {
-/*  float: left; */ 
   margin-bottom: 25px;   margin-bottom: 25px;
   border: 10px solid #fff;   border: 10px solid #fff;
Line 115: Line 124:
 .islandora_solr_result .label .islandora_solr_result .label
 { {
-  width: 20%;+  width: 180px;
   padding: 10px 10px 0px 0px;   padding: 10px 10px 0px 0px;
   vertical-align: top;   vertical-align: top;
   text-align: right;   text-align: right;
   background: #fff;   background: #fff;
 +}
 +
 +.islandora_solr_result .plabel
 +{
 +  width: 110px;
 +  padding: 0px 0px 0px 5px;
 +  vertical-align: bottom;
 +  text-align: left;
 } }
  
 .islandora_solr_result .value .islandora_solr_result .value
 { {
-  width: 80%; 
   padding: 10px 0px 0px 2px;   padding: 10px 0px 0px 2px;
   vertical-align: top;   vertical-align: top;
   text-align: left;   text-align: left;
-/*  background: #f0f0f0;*/ 
 } }
  
 .islandora_solr_result .ocrvalue .islandora_solr_result .ocrvalue
 { {
-  width: 80%; +  padding: 0px 5px 0px 5px;
-  padding: 0px 0px 0px 5px;+
   vertical-align: top;   vertical-align: top;
-  text-align: left+  text-align: right
-  font-size:0.875em;+  font-size:0.82em;
   background: #fff;   background: #fff;
 } }
 
 
frontend/searchres.txt · Last modified: 2013/09/05 11:38 by giancarlo

Developers: CNR IRCrES IT Office and Library
Giancarlo Birello (giancarlo.birello _@_ ircres.cnr.it) and Anna Perin (anna.perin _@_ ircres.cnr.it)
DigiBess is licensed under: Creative Commons License
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Drupal Garland Theme for Dokuwiki