1

I have one taxonomy named "Project Parameters" with hierarchical select and another taxonomy names "Project Sub Parameters" with hierarchical select.

I Want to filter the content with those taxonomies like on selection of Project parameter display its sub parameters and click on sub parameters with ajax call i need content filter

I Had created view and with contextual filter i achieve that but that load the page. I want to do same functionality with ajax only, No page reload.

Is it Possible? Please Help Me.. I am stuck since last 2 days.

  • Just want to make sure you have tried Use Ajax: Yes under Advance configuration of views. – arpitr Aug 24 '15 at 19:41
  • Yes i had tried ajax under advance configuration but not working.. – Sanjay Aug 25 '15 at 5:09
0

Create views for

  • Project parameters
  • Project sub parameters with contexual filter of project parameter taxonomy id with filter criteria
  • Content view with contexual filter of project sub parameters taxonomy id.

After Create these views you can call ajax api and pass those conexutal filter on ajax for particular view like,

$view = views_get_view('viewname'); //viewname is the view machine name
$view->set_display("block_1"); //block_1 is the view display name
$view->set_arguments($tid); //$tid is the argument to pass
$view->pre_execute();
$view->execute();
$content = $view->render();

I got the success by this way.

Hope this answer help somebody.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.