Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can do a “hijack” of the widget form submit and then use AJAX to load in the results to your existing page.
    Something like this worked for me (using jQuery):

    $('.taxonomy-drilldown-checkboxes').submit(function() {
    		// catch the form's submit event
    		target_el = $('div.target');
    
    		target_el.empty().html('<br/><h2>Please wait, loading...</h2>');
    	    $.ajax({ // create an AJAX call...
    	        data: $(this).serialize(), // get the form data
    	        type: $(this).attr('method'), // GET or POST
    	        url:  $(this).attr('action'), // the file to call
    	        success: function(response) { // on success..
    
    	        	// update the DIV - uses the "archive" template.
    	        	target_el.html($(response));	        	     
    
    	        }
    	    });
    	    return false; // cancel original event to prevent form submitting
    	});

    Bump.

    I would also like to be able to so this as I have about 6 custom taxonomies for 2 different custom post types and I need the results page to have a different layout to that of the plain archive page for these taxonomies.
    Depending on which is the first taxonomy in the query it chooses that archive page template to display the results – so the page looks different all the time too.
    Any help greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)