ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to search multiple fileds in weblog using {exp:weblog:entries search:filedname=""}

September 23, 2009 8:38am

Subscribe [5]
  • #1 / Sep 23, 2009 8:38am

    netlinkblueEE

    39 posts

    Hi,

    I have one simple text box on the front end to search the news weblog. to search the news (in all fields like title,subtitle, desc) iam using the below code.

    <?php
    
    $search_txt = $_POST["txt_title"];
    
    $vartest = $search_txt;
    
    ?> 
    
    {exp:weblog:entries  weblog="add_edit_news" search:news-subtitle="<?php echo $vartest; ?>" search:news-desc="<?php echo $vartest; ?>"}
    
    
    {title}<br><br>
    
     {/exp:weblog:entries}


    but the above code is not working if use multiple custom fields. can anyone give me the syntax to search in all the fields.

    thanks

  • #2 / Sep 23, 2009 5:18pm

    Boyink!

    5011 posts

    Why not just use the simple search tag?  You can configure it for a specific weblog.

  • #3 / Sep 23, 2009 5:29pm

    Lisa Wess

    20502 posts

    Using multiple search: is an AND statement, so only entries that match all search: statements will appear.

  • #4 / Sep 24, 2009 2:52am

    netlinkblueEE

    39 posts

    Thanks for the reply,

    Lisa: can you wirte the syntax for the multiple search using {exp:weblog:entries search : }

    Boyink: my look and feel of the search result page is diffrent fromm the default search result of the expression engine that why iam usnig the search or query module.

  • #5 / Sep 24, 2009 3:35am

    John Henry Donovan

    12339 posts

    netlinkblueEE,

    Boyink: my look and feel of the search result page is diffrent fromm the default search result of the expression engine that why iam usnig the search or query module.

    Any template can become your search results page which you can style and add your own content to, just like any other template.

    On your new template you use Search Results Tag

  • #6 / Sep 24, 2009 9:23am

    netlinkblueEE

    39 posts

    How can i control the form action on the search form ? i want to send the form action to differnt page

  • #7 / Sep 24, 2009 9:37am

    Boyink!

    5011 posts

    The result page is a parameter, as is the no result page.

  • #8 / Sep 24, 2009 2:31pm

    Lisa Wess

    20502 posts

    The syntax for the multiple search is as you have it - just using multiple search: parameters.

  • #9 / Oct 30, 2009 7:18pm

    supercollidr

    5 posts

    Can someone clarify - is it possible to do an “OR” kind of search based on multiple search parameters using the weblog tag or not?

  • #10 / Oct 30, 2009 7:28pm

    Lisa Wess

    20502 posts

    supercollidr - no, you could put a feature request in for that though.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases