php 如何以编程方式使用panelizer将窗格添加到节点

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 如何以编程方式使用panelizer将窗格添加到节点相关的知识,希望对你有一定的参考价值。

<?php
    // This code can be used in a hook_update_n to add a custom pane to an existing display in panelizer.
  
    // Example variables used in the code below.
    $nid = 1;
    $pane_machine_name = 'my_example_custom_pane';
    $region = 'content';
    $position = 0;
    
    
    // Load the node and save its display as modified, this is required so panelizer knows there's new stuff.
    $node = node_load($nid);
    $node->panelizer['page_manager']->display_is_modified = TRUE;
    node_save($node);
    // Change the display.
    $display = panels_load_display($node->panelizer['page_manager']->display->did);
    $new_pane = panels_new_pane($pane_machine_name, $pane_machine_name, TRUE);
    $new_pane->panel = $region;
    $new_pane->position = $position;
    $display->panels['main-content'][] = $new_pane->pid;
    $display->content[$new_pane->pid] = $new_pane;
    panels_save_display($display);

以上是关于php 如何以编程方式使用panelizer将窗格添加到节点的主要内容,如果未能解决你的问题,请参考以下文章

将 UI 插入另一个 MFC 对话框

iPad SplitViewController 以编程方式显示弹出框

如何以编程方式滚动面板

以编程方式启动 Mac 的系统偏好设置屏幕 -> 声音

如何以编程方式控制行的切换?

如何以编程方式打开选项菜单?