首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >render()函数之前或之后的Drupal挂钩

render()函数之前或之后的Drupal挂钩
EN

Stack Overflow用户
提问于 2014-08-05 18:32:17
回答 1查看 644关注 0票数 0

我的drupal页面有问题。我们使用opigno工具(它是一个模块,可以用来创建可以购买的课程节点)。

现在我们在课程节点的视图上遇到了一个问题。一切正常,直到用户购买了课程,drupal的商务状态为"pending“。现在的问题是,除了课程的标题之外,节点什么也不显示。

我开始思考到底发生了什么,并查看了课程视图的视图设置。无(未设置权限,无筛选条件...)

然后,我看了一下course-view的模板覆盖。然后我看到史密斯..。

代码语言:javascript
复制
print render($content['body']);

阿!渲染功能,用于渲染视图的内容。所以我问自己:什么是内容?

在打印出$content变量后,我看到了以下内容:

代码语言:javascript
复制
Array
(
[body] => Array
        (
            [#theme] => field
            [#weight] => 1
            [#title] => Description
            [#access] => 
            [#label_display] => hidden
            [#view_mode] => full
            [#language] => und
            [#field_name] => body
            [#field_type] => text_with_summary
            [#field_translatable] => 0
            [#entity_type] => node
            [#bundle] => course
            [#object] => stdClass Object
                (
                    [vid] => 185
                    [uid] => 60
                    [title] => Demo Course
                    [log] => 
                    [status] => 1
                    [comment] => 1
                    [promote] => 0
                    [sticky] => 0
                    [vuuid] => 16e7999b-28bb-4f3e-8bed-54a21b17f398
                    [nid] => 176
                    [type] => course
                    [language] => und
                    [created] => 1406897520
                    [changed] => 1407145285
                    [tnid] => 0
                    [translate] => 0
                    [uuid] => 22baf19a-dc32-4137-b698-89f1bb4adc59
                    [revision_timestamp] => 1407145285
                    [revision_uid] => 1
                    [body] => Array
                        (
                            [und] => Array
                                (
                                    [0] => Array
                                        (
                                            [value] => 

This is a sample course for beta testers, it will show you the structure of the courses.

Here usually is displayed the description of the course.

Please "enroll" if you want to see the contents of this demo course. 

                                            [summary] => This is a sample course for beta testers to help you see the structure of a course. Please have a look on it!
                                            [format] => html
                                            [safe_value] => 

This is a sample course for beta testers, it will show you the structure of the courses.

Here usually is displayed the description of the course.

Please "enroll" if you want to see the contents of this demo course. 

                                            [safe_summary] => This is a sample course for beta testers to help you see the structure of a course. Please have a look on it!
                                        )

                                )

                        )
)

啊!所以$content有内容,但是没有用render()打印出来!但是为什么呢?

我在google中搜索了一个钩子,它能够“覆盖”呈现函数,并可能在用户处于“挂起”状态时拒绝输出。但是..。没什么。我发现了这个钩子:

代码语言:javascript
复制
{hook}_node_view()

我在所有模块中都搜索了这个钩子的用法,但是从模块中删除这些函数并没有改变任何事情。是否有其他选项可以“覆盖”render()函数?另一个我可以搜索的钩子?或者你也有同样的问题?

EN

回答 1

Stack Overflow用户

发布于 2014-08-05 19:35:27

很抱歉-问题出在Opigno字段访问模块。我把它停用了,它就像护身符一样有效。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25136640

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档