English 中文(简体)
在运行时更改块区域(Drupal 6)
原标题:Changing block region on runtime (Drupal 6)
最佳回答

真的需要这样展示吗

在my_region中使用自定义模块和hook_block()添加一个块

根据模块本身的移动主题条件,使用内部的自定义php代码显示所有块内容

如果块的类型为view,请使用以下代码打印视图内容:

    

    $view = views_get_view( view name );
    $view->set_display( block_1 ); //or the block id in the view
    $view_block = $view->execute_display( block_1 , array()); 
    //pass any arguments if any in the second argument
    print $view_block[ content ];

如果它仅属于block类型,请使用:


    $block = module_invoke( module_name["block" for blocks created from web interface] ,  block ,  view ,  delta );

    print $block[ content ];

如果这让我感到困惑,请告诉我。

问题回答

暂无回答




相关问题
Drupal Multi-language: Simple strings not translated

I m adding additional languages to a Drupal site that I m building. Getting the translation of content working is fairly easy using the Internationalisation module. Yet, simple things such as date ...

Setting up a WYSIWYG editor for Drupal site users [closed]

Looking through the Drupal contrib modules, and after a few Google searches, it becomes evident that there are any number of choices and combos available to set up a WYSIWYG editor in Drupal. I m ...

Change size of user/password login box

I don t know how to change the size of the login username/password boxes on the drupal site that I m trying to build. I m stumbling through the theming, and don t know where to find the file that ...

How does Drupal provide an edit/review/publish model?

How does Drupal support a means to update and review a website before it is published? Does it only allow you to preview a page at a time before you publish it or is there a way to create a site ...

Term for rotating header

I m looking for terminology that describes this behavior: The header of a web-page contains a different image every time you visit it. Update: It is not an advertisement, but images related to the ...

Has anyone checked out Drupal 7? [closed]

Has anyone checked out a copy of Drupal 7 yet? What do people think? I m pretty excited about the PDO and all of the designers I work with a very excited about the new admin interface/structure. Do ...