how to pass argument to exported views code?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
gobinathm.php's picture

Hey people,

I'm working with drupal views and im new to drupal. I did exported the views and creating a widget with that exported views. I have no idea how to pass argument to that exported views.

http://pastebin.com/YzzzLEbW

i just want to pass url args and filter the views result accordingly and also pagination too.

if i pass ?page=0,1 in url it wont reflect any change.please help me with this.

if you like to contact mgobi.php AT gmail.com

Thanks,
Gobi.

Comments

Your question does not make

merlinofchaos's picture

Your question does not make any sense.

really i hope you understand by this

gobinathm.php's picture

I did exported the views and using those code as custom view to create a embed js widget(embed on any website). The embed widget list all our nodes created through custom views and also have some filters along with pagination. i just wanna pass arguments to this custom code to do filter and pagination functions. my code snippets

function view_code(){

http://pastebin.com/YzzzLEbW (i exported this code here)
$view->execute();
return $view->result;
}

function show_widget(){

$array=view_code();

print_r($array);(from this array i created a js widget)

}

right now the returned array just show first 10 result .

i have no idea how to show next 10 result and how to apply filters

Still don't have a clue what

ludo1960's picture

Still don't have a clue what you're asking.....guessing this will help though http://drupal.org/node/129532

That's a really odd way to

merlinofchaos's picture

That's a really odd way to use a view. I'm not really sure you should be using a View that way, though I guess you can.

If you want to pass in arguments, use $view->set_arguments().

If you want to change the current page, use $view->current_page().

Wow, sorry. I got both

merlinofchaos's picture

Wow, sorry. I got both wrong:

$view->set_argument(array(arg1, arg2, arg3)) and $view->set_current_page(pagenumber).

let me try those

gobinathm.php's picture

Hi Merlin,

what else to do lol we did this with custom module, But client (i think drupal geek) rejected those and asking for drupal views widget :(.

Thanks & have a great day,
Gobi

merlin you are geek :)

gobinathm.php's picture

Hey it works

can you guide me how to do sorting like this way and filtering too please :)

we know i never tasted beer and now i have to do this with you :)

have a great day

He was trying to make widgets

jcisio's picture

He was trying to make widgets for other websites.

thanx god

gobinathm.php's picture

jcisio you got it im creating widget with iframe and ajax for pagination and sorting :)

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: