帮我继续处理 drupal 视图吗?

发布于 2024-09-17 09:11:04 字数 897 浏览 7 评论 0原文

我是 drupal 的新手,我刚刚创建了一个名为“master”的视图,我想以语法方式操作输出程序以创建小部件(javascript 小部件可以嵌入其他网站)。

  $view = views_get_view('master');
  $view->set_display('page');
  $view->execute();
  $viewArray = $view->result;
  $title = $view->display['default']->display_options['title'];
  echo "<h2>$title</h2>";
  echo("<pre>"); print_r ($viewArray); echo("</pre>");

它打印结果(以对象形式),但输出仅包含在创建视图时提到的 10 个结果。请指导我,

1.how to get the next 10 result pro grammatically (pagination) ?

2.how to theme a views  pro grammatically (since its js widget) ?

3.any live demo tutorial links to play with advanced views?

4.how to do sorting (whether i need to pass through url)?

5.how deal this with handler object?

我的视图预览如下图所示

alt text

谢谢,

Nithish。

I am newbie to drupal , I just created a view called "master" and i wanna manipulate the output pro grammatically for creating widget (javascript widget can embed in other website).

  $view = views_get_view('master');
  $view->set_display('page');
  $view->execute();
  $viewArray = $view->result;
  $title = $view->display['default']->display_options['title'];
  echo "<h2>$title</h2>";
  echo("<pre>"); print_r ($viewArray); echo("</pre>");

It prints the result(in object form), But the output contains only 10 result which was mentioned while at the time of views creation.Please guide me,

1.how to get the next 10 result pro grammatically (pagination) ?

2.how to theme a views  pro grammatically (since its js widget) ?

3.any live demo tutorial links to play with advanced views?

4.how to do sorting (whether i need to pass through url)?

5.how deal this with handler object?

my view preview looks like this below image

alt text

Thanxs,

Nithish.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

请爱~陌生人 2024-09-24 09:11:04

好吧,对于#1,您需要做的就是进入该视图的编辑控制面板并更改每页上显示的记录数。将其设置为 0 可以一次显示所有记录。

对于其他人......我想知道 views 是否是适合您的解决方案。我怀疑您可能会更好地使用返回大量 drupal_json() 调用的自定义模块。至少,通过视图完成所有这些工作既麻烦又浪费,因为视图在渲染上花费了很多周期。

如果您想避免编写自定义模块,我建议安装 View Bonus Pack (http://drupal. org/project/views_bonus)并使用“Feed”显示类型。这将使使用 js 操作结果变得更加容易。

Well, for #1 all you need to do is go into the edit control panel for that view and change the number of records to be shown on each page. Setting it to 0 lets it display all records at once.

For the others ... I wonder if views is the right solution for you. I suspect you might be better off with a custom module that returns a lot of drupal_json() calls. At very least, it's cumbersome and wasteful to be doing all this through views, since views spends so many cycles on rendering.

If you want to avoid coding a custom module, I'd suggest installing the View Bonus Pack (http://drupal.org/project/views_bonus) and using the 'Feed' display types. This will make it marginally easier to manipulate the results with js.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文