[Silva-general] "silva find" in a code source?
Kit BLAKE
kitblake at infrae.com
Wed Apr 29 13:26:25 CEST 2009
If you install the documentation you'll find a Find (heh :)) and
search field embedded in a template. Or go to:
http://www.infrae.com/products/silva/docs
The code is in the layout_macro. You should be able to copy it into a
code source page template without much trouble. To save you digging,
this is the code, including a javascripted hint in the field:
<div class="documentation_search"
tal:condition="python: hasattr(here.get_root().service_views,
'SilvaFind')">
<form action="" name="searchform"
tal:attributes="action python:here.search.absolute_url()"
tal:define="docroot
python:'%s/'%'/'.join(here.search.getPhysicalPath()[:-1])">
<input name="fulltext" id="fulltext" value="" size="19"
class="store" type="text"
tal:attributes="value
python:unicode(request.form.get('fulltext', 'Search documentation'),
'utf8')"
onkeyup="if (event.keyCode == 13){this.form.submit()};"
onclick="if (this.value == 'Search documentation')
{this.value=''};">
<!--<input class="button searchform-submit" value="Search"
accesskey="s" title="access key: alt-s" type="submit">-->
<input name="search_submit" type="hidden" value="1"/>
<input name="path" type="hidden" tal:attributes="value
docroot"/>
</form>
<script language="javascript">document.searchform.fulltext.select();</
script>
</div>
For the post-search filtering, you probably want to send that through
a Python script that then returns the result.
Kit
On 29 Apr 2009, at 12:51, Raoul Schaffner wrote:
> dear all,
>
> i need to perform a full text search over a folder inside my
> silva root, collect all hits, omit the dupes and present the
> found set in a special way. i'll write a code source for that.
>
> question: is it possible to tap into silva find in order to
> perform the full text search? how would i do that?
>
> thanks for any hints,
> raoul schaffner.
>
>
> °°°
> Raoul Schaffner
> Eawag
> Informatik
> Überlandstrasse 133
> Postfach 611
> 8600 Dübendorf
> Schweiz
>
> Telefon +41 (0)44 823 5548
> Telefax +41 (0)44 823 5210
> raoul.schaffner at eawag.ch
> http://www.eawag.ch
>
>
>
> _______________________________________________
> silva-general mailing list
> silva-general at lists.infrae.com
> https://lists.infrae.com/mailman/listinfo/silva-general
More information about the silva-general
mailing list