Moodle 为所有用户添加一个新块作为管理员,以显示在所有页面上 [英] Moodle Add a new block as Admin for all users , to appear on all pages
问题描述
我创建了一个输出 Html 的简单自定义块.我想将它添加到首页上下文中,页面->上下文在整个站点中显示".我用谷歌搜索并找到了程序:
I have a created a simple custom block that outputs Html. I want to add it in front page context with page->context "Display throughout the entire site". I googled and found the procedure :
- 作为管理员,打开首页的编辑功能,然后添加您想要置顶的区块.
- 对于此块出现的位置>页面上下文,选择在整个站点中显示".
- 根据您的喜好决定其他设置并保存.
- 该区块现在将出现在您 Moodle 的所有页面上.
我只是无法添加带有上下文首页的块.因此,我没有得到在整个网站上显示".
I am just not able to add the block with context front page. Hence, I do not get "Display throughout the entire site".
也不为学生和教师添加.
Also it is not added for students and teachers.
请帮忙.
Moodle 版本:2.8.5
Moodle version : 2.8.5
推荐答案
您可能需要将此添加到 /blocks/yourblockname/block_yourblockname.php
中的 class block_yourblockname
You might need to add this to class block_yourblockname
in /blocks/yourblockname/block_yourblockname.php
function applicable_formats() {
return array('all' => true);
}
适用格式限制块,因此它只出现在某些页面上.
Applicable formats restricts the block so it only appears on certain pages.
https://docs.moodle.org/dev/Blocks#Authorized_Personnel_Only
这篇关于Moodle 为所有用户添加一个新块作为管理员,以显示在所有页面上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!