how to pass argument to exported views code?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by gobinathm.php on September 6, 2010 at 7:39am

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.

Categories:

Comments

Your question does not make

Posted by merlinofchaos on September 6, 2010 at 7:51am

Your question does not make any sense.

really i hope you understand by this

Posted by gobinathm.php on September 6, 2010 at 8:46am

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

Posted by ludo1960 on September 6, 2010 at 2:35pm

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

Posted by merlinofchaos on September 6, 2010 at 3:58pm

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

Posted by merlinofchaos on September 6, 2010 at 4:17pm

Wow, sorry. I got both wrong:

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

let me try those

Posted by gobinathm.php on September 7, 2010 at 5:49am

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 :)

Posted by gobinathm.php on September 7, 2010 at 7:32am

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

Posted by jcisio on September 6, 2010 at 4:43pm

He was trying to make widgets for other websites.

thanx god

Posted by gobinathm.php on September 7, 2010 at 5:47am

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:

AltStyle によって変換されたページ (->オリジナル) /