source: gs3-extensions/solr/trunk/src/conf/velocity/product_doc.vm@ 29135

Last change on this file since 29135 was 29135, checked in by ak19, 10 years ago

Part of port from lucene3.3.0 to lucene4.7.2. Solr related. conf and lib folders for solr4.7.2.

File size: 1.5 KB
Line 
1#**
2 * Render a hit representing a Product
3 * assumed to have a field called "name"
4 *#
5
6<div class="result-title"><b>#field('name')</b><span class="mlt"> #if($params.getBool('mlt', false) == false)<a href="#lensNoQ&q=id:$docId&mlt=true">More Like This</a>#end</span></div>
7##do we have a physical store for this product
8#set($store = $doc.getFieldValue('store'))
9#if($store)<div class="map"><img src="http://maps.google.com/maps/api/staticmap?&zoom=12&size=150x80&maptype=roadmap&markers=$doc.getFieldValue('store')&sensor=false" /><div><small><a target="_map" href="http://maps.google.com/?q=$store&amp;source=embed">Larger Map</a></small></div></div>#end
10<div>Id: #field('id')</div>
11<div>Price: #field('price_c')</div>
12<div>Features: #field('features')</div>
13<div>In Stock: #field('inStock')</div>
14<div class="mlt">
15 #set($mlt = $mltResults.get($docId))
16 #set($mltOn = $params.getBool('mlt'))
17 #if($mltOn == true)<div class="field-name">Similar Items</div>#end
18 #if ($mltOn && $mlt && $mlt.size() > 0)
19 <ul>
20 #foreach($mltHit in $mlt)
21 #set($mltId = $mltHit.getFieldValue('id'))
22 <li><div><a href="#url_for_home?q=id:$mltId">$mltId</a></div><div><span class="field-name">Name:</span> $mltHit.getFieldValue('name')</div>
23 <div><span class="field-name">Price:</span> $!number.currency($mltHit.getFieldValue('price')) <span class="field-name">In Stock:</span> $mltHit.getFieldValue('inStock')</div>
24
25 </li>
26 #end
27 </ul>
28 #elseif($mltOn && $mlt.size() == 0)
29 <div>No Similar Items Found</div>
30 #end
31</div>
32#parse('debug.vm')
Note: See TracBrowser for help on using the repository browser.