Forums Forums Search Search Results for 'current_query'

Viewing 10 results - 301 through 310 (of 344 total)
  • Author
    Search Results
  • #55931

    Anonymous
    Inactive

    So this is kind of similar to a question I’ve already asked. But now I’m struggling with the styling of the echo.

    To echo the checked boxes I use the following code:

    function locaties_search() {
        global $searchandfilter;
        $sf_current_query = $searchandfilter->get(3403)->current_query();
        return $sf_current_query->get_fields_html(array("_sft_locatie"), array('show_all_if_empty' => false));
    }
    
    add_shortcode('locatiesearch', 'locaties_search');

    And then I use the following shortcode to echo the results:
    <?php echo do_shortcode('[locatiesearch]'); ?>

    Right now it’s displaying the results like:
    Location:Location-x, Location-y

    What I would like is to have it just echo like so:
    Location-x
    Location-y

    What code should I use?

    #52218

    In reply to: Getting value from url


    Anonymous
    Inactive

    Well, that breaks the code, the part where the echo should be doens’t show anymore. The rest doesn’t show neither.

    <?php global $searchandfilter;
    $sf_current_query = $searchandfilter->get(15)->current_query()->get_array();
    foreach($sf_current_query as $key) {
      echo '<div>' . $key['name'] . '</div>';
      echo '<div>' . $key['active_terms'][0]['name'] . '</div>';
    } ?>
    #52114

    In reply to: Getting value from url


    Trevor
    Participant

    What does this give?

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(339)->current_query()->get_array();
    foreach($sf_current_query as $key) {
      echo '<div>' . $key['name'] . '</div>';
      echo '<div>' . $key['active_terms'][0]['name'] . '</div>';
    }
    #52093

    In reply to: Getting value from url


    Trevor
    Participant

    What does this give you?

    <?php
       //Get a multiple fields values by passing an array of field names
       //replace 1526 with the ID of your search form
    	global $searchandfilter;
    	$sf_current_query = $searchandfilter->get(15)->current_query();
    	print_r($sf_current_query);
    ?>
    #52078

    In reply to: Getting value from url


    Trevor
    Participant

    This?

    <?php
       //Get a multiple fields values by passing an array of field names
       //replace 1526 with the ID of your search form
    	global $searchandfilter;
    	$sf_current_query = $searchandfilter->get(15)->current_query();
    	print_r($sf_current_query->get_fields_html(array(), array('show_all_if_empty' => false)));
    ?>
    #52076

    In reply to: Getting value from url


    Trevor
    Participant

    I see the error. My bad for copying and pasting. The forum has changed the quotes 🙁

    <?php
       //Get a multiple fields values by passing an array of field names
       //replace 1526 with the ID of your search form
    	global $searchandfilter;
    	$sf_current_query = $searchandfilter->get(15)->current_query();
    	print_r $sf_current_query->get_fields_html(array(), array('show_all_if_empty' => false));
    ?>

    Or, I hope that is it.

    #52072

    In reply to: Getting value from url


    Anonymous
    Inactive

    If I use this code:

    <?php
       //Get a multiple fields values by passing an array of field names
       //replace 1526 with the ID of your search form
    	global $searchandfilter;
    	$sf_current_query = $searchandfilter->get(15)->current_query();
    	print_r $sf_current_query->get_fields_html(array(), array(‘show_all_if_empty’ => false));
    ?>

    It “breaks” the page…?

    #52071

    In reply to: Getting value from url


    Trevor
    Participant

    I need to see the array structure to know which element to grab. This code instead of the current echo should give the array:

    print_r $sf_current_query->get_fields_html(array(), array(‘show_all_if_empty’ => false));
    
    #51940

    In reply to: Getting value from url


    Anonymous
    Inactive

    <?php echo $sf_current_query->get_fields_html(array("_sft_aantal_personen","_sft_arrangementstype","_sft_type_boot","_sft_type_boot_2","_sft_boot_opties"), array('show_all_if_empty' => false)); ?>

    This…

    #51933

    In reply to: Getting value from url


    Anonymous
    Inactive

    Hi Trevor,

    I think it’s this part:

    <?php
        //Get a multiple fields values by passing an array of field names
        //replace 1526 with the ID of your search form
    	global $searchandfilter;
    	$sf_current_query = $searchandfilter->get(15)->current_query();
    ?> 
    
    <?php $arrangement = $sf_current_query->get_fields_html(array("_sft_aantal_personen","_sft_arrangementstype","_sft_type_boot"), array('show_all_if_empty' => false)); ?>

    I like to keep my echo’s separate from the rest… so I can echo them where ever I like.

Viewing 10 results - 301 through 310 (of 344 total)