Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorhobie
    • CommentTimeJun 9th 2008
     permalink
    What can I change to make the search box (the one added as a widget in the sidebar) search full text by default, rather than just titles?
    •  
      CommentAuthorNoWhereMan
    • CommentTimeJun 9th 2008
     permalink
    in fp-plugins/searchbox/plugin.searchbox.php;

    if you're using the compact mode, change


    $content = '<ul><li>
    <form method="get" action="'.$url.'">';


    and make it


    $content = '<ul><li>
    <form method="get" action="'.$url.'">
    <input type="hidden" name="stype" value="full" />';


    otherwise, if you're using full mode (SEARCHBOX_BIG)

    change

    if (SEARCHBOX_BIG)
    $content .=
    '<p><label><input type="radio"
    name="stype" value="titles" checked="checked" />'.
    $lang['search']['onlytitles'] .
    '</label><br />'.
    '<label><input type="radio" name="stype" value="full" />'.
    $lang['search']['fulltext'] .
    '</label></p>';


    to


    if (SEARCHBOX_BIG)
    $content .=
    '<p><label><input type="radio"
    name="stype" value="titles" />'.
    $lang['search']['onlytitles'] .
    '</label><br />'.
    '<label><input type="radio" name="stype" value="full" checked="checked" />'.
    $lang['search']['fulltext'] .
    '</label></p>';



    HTH
    •  
      CommentAuthorhobie
    • CommentTimeJun 9th 2008 edited
     permalink
    Thank you, it worked perfectly (it was compact mode I was after).

    It would be neat if the full post(s) appeared in the search results, but I suspect that would be a more complicated thing.
    •  
      CommentAuthorNoWhereMan
    • CommentTimeJun 10th 2008
     permalink
    hmm, well, it would work only with full text but it's technically possible

    open fp-interface/sharedtpls/search_resuts.tpl

    <ol>
    {search_result}
    <li><a href="{$id|link:post_link}">{$subject}</a></li>
    {/search_result}
    </ol>



    and change into

    <ol>
    {search_result}
    <li>
    <h4><a href="{$id|link:post_link}">{$subject}</a></h4>
    <p>{$content}</p> {* this will dump your entry without parsing contents *}
    </li>
    {/search_result}
    </ol>


    also

    <ol>
    {search_result}
    <li>
    <h4><a href="{$id|link:post_link}">{$subject}</a></h4>
    {$content|tag:the_content} {* this will parse the entry: slower! - notice I've removed the paragraphs *}
    </li>
    {/search_result}
    </ol>



    you can also add the |truncate modifier to truncate the string:

    <p>{$content|truncate:80:"&hellip;":true}</p>

    this will truncate at the 80th character, adding an hellipsis (…) and at word boundaries

    {$content|truncate:80:"&hellip;":true|tag:the_content}

    this will truncate and then parse the string

    bye
    •  
      CommentAuthorhobie
    • CommentTimeJun 10th 2008
     permalink
    Thank you!
    •  
      CommentAuthoralexfp
    • CommentTimeDec 6th 2008
     permalink
    Ottimo!
    Sarebbe possibile evidenziare le parole ricercate nel contenuto del post o รจ troppo complicato?
    Grazie.
    Ciao
    •  
      CommentAuthorPanther
    • CommentTimeAug 17th 2010
     permalink
    I followed all and it works! But the "problem" is that the Search doesn't search on static pages (Admin-Statics-Manage Static).
    If you go on http://www.warsintheworld.com/ and search (Punjab) you can find 3 results, but you don't find the result on static page:

    http://www.warsintheworld.com/?page=static1258254223

    If someone wants search a name of guerrilla group not present on article, he can't find it.
    Do you know how to do ?
    Thank you very much.