Note: You are currently viewing documentation for Moodle 2.9. Up-to-date documentation for the latest stable version of Moodle may be available here: Blocks FAQ.

Blocks FAQ: Difference between revisions

From MoodleDocs
(updated for 2.0: How do I hide front page blocks from non-logged-in users?)
 
(41 intermediate revisions by 9 users not shown)
Line 3: Line 3:


# Click the "Turn editing on" button at the top-right of the front page. (You need to be logged in as an administrator.)
# Click the "Turn editing on" button at the top-right of the front page. (You need to be logged in as an administrator.)
# Access the assign roles page via the assign roles icon (a face and mask) in the header of the block to be hidden.
# Click the assign roles icon (often a face and mask) in the header of the block to be hidden. ('''NOTE''': Don't worry if you get an error message saying you are not able to assign roles ;) )
# Scroll down to the settings block and click the Permissions link
# Scroll down to the settings block and click the Permissions link
# [[File:Blockassign.png]]
# [[File:Blockassign.png]]
# In the ''View block'' section, click the X next to ''Guest''
# In the ''View block'' section, click the X next to ''Guest''
# Click the "Save changes" button.
# Click the "Save changes" button.
Alternatively, to hide all blocks from non-logged in users, you can go to ''Administration>Site administration>Users>Permissions>Define roles'' and edit the Guest role to disallow ''View block''.
==How do I show front page blocks to guests and hide them from logged in users?==
# Click the "Turn editing on" button at the top-right of the front page. (You need to be logged in as an administrator.)
# Click the assign roles icon (in the header of the block to be hidden. ('''NOTE''': Don't worry if you get an error message saying you are not able to assign roles ;) )
# Scroll down to the settings block and click the Permissions link
# [[File:Blockassign.png]]
# In the ''View block'' section, click the X next to ''authenticated user''
# Click the "Save changes" button.
==How do I get rid of a link in "Site Pages" in the Navigation block?==
When a resource or activity (like a page, file or forum) is added to the [[Main menu block]]  on the front page, it will appear in the Site Pages of the Navigation block. If you need the item but don't want it to display then go to ''Site administration>Appearance>Navigation'' and uncheck "show front page activities in the navigation". If you no longer want the item then turn on the editing on the front page, go to or add the [[Main menu block]] and click to delete the item.


==How do I make a front page block visible to teachers but not students?==
==How do I make a front page block visible to teachers but not students?==
It is possible to control who sees block on the front page. The following applies to any specified group of people, not just teachers and students.
It is possible to control who sees block on the front page. The following applies to any specified group of people, not just teachers and students.
# Ensure you have hidden your block  from non-logged in users as above
# Ensure you have hidden your block  from non-logged in users as in the instructions above.
# In site administration>users>permissions>define roles, create a new role such as "front page block viewer"
# In ''Administration>Site administration>Users>Permissions>Define roles'', click on "authenticated user on the front page"
#Click the "Turn editing on" button on your front page
# In the context type, select "block"  
# Set ''moodle/block:view'' to "allow". Save the changes.
#Turn editing on on your front page.
#Click the "assign roles " icon on your block.
#Click the "assign roles " icon on your block.
#Click the blue words of your new role. They link to the assign roles page. Choose who you want to allow to see this block (such as your teachers) by moving them from the right hand box to the left.
#Click the blue words of "authenticated user on the front page" to access the screen where you can choose who you want to allow to see this block (such as your teachers) by moving them from the right hand box to the left.
#Click the "Override permissions" tab
#Now click "Permissions" in your block's Administration settings
#For your new role, press the "allow" button to allow them to view this block
#Click the X next to "authenticated user" to prevent them viewing this block.
#For the authenticated user, press the "prevent" button to prevent them seeing this block
#From now on, regular authenticated users will not be able to see the block. However, those who have been given the role of "authenticated user on the front page" will be able to see it.
#Click the "Save changes"button.
 
==How do I make a block in my course visible to teachers but not students?==
Here are two suggestions:
 
1.Add a block to a page which only teachers can see, for example ''/grade/report/grader/index.php'' You could add a comments block for teachers to discuss and moderate each others' grades. Alternatively,you could add an HTML block to  ''/badges/index.php'' with badge issuing policies. A block may also be added to ''enrol/users.php'' for notes or comments regarding enrolments.
 
2.Add a block to the main course page and ask your administrator to go to ''Block>Assign roles>Permissions'' and prevent authenticated users and students from viewing the block. (A regular teacher cannot change permissions of authenticated users.)
 
==How can I change a Block item name from a list inside a block?==
You can change an item name in  ''Settings>Site Administration > Language> Language customization'' Select the 'moodle.php' file then search for the words you need to alter.


==I want to hide the Latest News Block from anyone not logged in.==
==How to I make a block "sticky"?==
This example will work for all [[:Category:Block|blocks]].  
See [[Block settings]]. Using the edit icon in the block heading, go to the configuration page.  Look for the "Where this block appears" group and "Display on page types".  Depending upon your current context and permissions, you will see different options.  One maybe "All pages" or "Any type of course main page", and others.


#Log in as an Administrator then turn editing on
==Where did that block come from?  I do not want it!==
# Click on the assign roles icon (usually the first icon and looks like [[Image:Assignrolescmf01.gif]] one of these) in the header of the [[Block|block]] to be hidden, in this case the [[Latest News block]]. This takes you to the Assign roles page.
Your site administrator or some one with more permissions than you decided that block should be there. It is possible to force a block to appear on other pages.  For example, a site administrator my force a HTML block on every main course page and determine where it will be, so they may put site messages there. 
# Click the "Override permissions" tab.
 
# Select the role "Guest".
Your site administrator can tell where every instance of a block appears via [[Blocks administration]].
# Reset the capability moodle/block:view to '''prevent'''.
 
# Click the "Save changes" button.
==How can I decide the order in which blocks are docked?==
Blocks are "docked", from top to bottom (usually on the left) in the order in which you dock them.
 
==How can I add a block to all user profile pages?==
 
See [[User profiles]] for instructions.
 
==How can I prevent users from adding blocks to their dashboard page?==
 
See [[Dashboard]] for instructions.
 
==The blocks have disappeared from the front page/course page!==
This can sometimes be caused by users pasting from Microsoft Word which corrupts the formatting. See this forum post for more details https://moodle.org/mod/forum/discuss.php?d=217390#p958884
 
==Help, I accidentally hid the administration block without realising the consequences!==
 
# Go to <nowiki>http://yourmoodlesite.org/admin/blocks.php</nowiki>
# Unhide the administration block by clicking the closed eye icon opposite it
 
==I accidentally deleted the navigation (or administration) block!==
 
# Go to ''Administration > Site administration > Plugins > Blocks > Manage blocks'' (or via the URL <nowiki>http://yourmoodlesite.org/admin/blocks.php</nowiki>) and unprotect the navigation block by clicking the padlock icon
# Turn editing on in any course
# Go to the front page and use the 'Add a block' dropdown menu to add a navigation block there, setting it to display throughout the entire site
# Go back to ''Administration > Site administration > Plugins > Blocks > Manage blocks'' and re-protect the navigation block.
 
The above method works the same for the navigation and administration blocks.
 
==My Administration block links don't expand!==
 
This has been noticed as a Javascript problem. Given the many possible factors behind this issue, each situation is different. Please try to:
 
1. Use another browser or use another version of the same browser (try both, lower and higher versions).
 
2. [[Purge all cache]] (Administration > Development > Purge all caches): ''<code>http://yoursite.com/</code>''<code>admin/purgecaches.php</code>
 
3. Change the Use slash arguments option at the [[HTTP]] page (Administration > Server > HTTP): ''<code>http://yoursite.com/</code>''<code>admin/settings.php?section=http</code>
 
4. Try different settings at the [[AJAX and Javascript settings]] page (Administration > Appearance > AJAX and Javascript): ''<code>http://yoursite.com/</code>''<code>admin/settings.php?section=ajax</code>
 
* Enabling the Use online YUI libraries (''useexternalyui'') sometimes has solved the problem (see [http://tracker.moodle.org/browse/MDL-31678 tracker.moodle.org/browse/MDL-31678]).
 
5. [http://www.enable-javascript.com/ Turn off Javascript] in your browser (the linked site shows how to enable Javascript, so do the opposite)
 
6. [http://www.java.com/en/download/help/disable_browser.xml Turn off Java] (you should have it disabled anyway, unless you really need it)
 
7. Try using another theme: ''<code>http://yoursite.com/</code>''<code>theme/index.php</code>
 
8. If you are using the <code>$CFG->httpswwwroot</code> directive (for SSL login) at the '''config.php''' configuration file, try and comment it (add a double forward slash and a space "// " at the beginning of the line), like so:
 
// $CFG->httpswwwroot = etc.
 
9. At the Moodle '''config.php''' configuration file, add the following line to set the default time zone (please use the [http://php.net/manual/en/timezones.php List of supported timezones]):
 
date_default_timezone_set("''valid-timezone''");
 
For example, to set the time zone for Sofia, Bulgaria, add the following line:
 
date_default_timezone_set("Europe/Sofia");
 
'''Note'''. If possible, it would actually be better to add the time zone setting directive to the PHP '''php.ini''' configuration file (please see [http://php.net/manual/en/datetime.configuration.php#ini.date.timezone PHP Runtime configuration]):
 
date.timezone ''valid-timezone''
 
You should also:
 
1. Enable [[Debugging]] (Administration > Development > Debugging): ''<code>http://yoursite.com/</code>''<code>admin/settings.php?section=debugging</code>, as this may provide possible useful information regarding the cause.


This should hide the block from everyone until they have logged in.
2. Check if your browser is showing some warning or error indications (watch the status bar).


==I hid the administration menu from the blocks page and now I have no way of showing any module blocks because I can't get to the admin menu to show anything.==
For more details see any of the following forum threads https://moodle.org/mod/forum/discuss.php?d=269877#p1166200, https://moodle.org/mod/forum/discuss.php?d=166994 or https://moodle.org/mod/forum/discuss.php?d=200243 or the tracker MDL-31678.
Log into your Moodle as normal and then type this:
  <nowiki>(http://www.mysitename.org/)admin/blocks.php</nowiki>
into the address bar. This will take you directly to the blocks page and you will be able to reset any hidden block.


==When I try to select some pages in the Admin block, I get a "Timed Out" message and the screen reverts to the login page==
==How can I add a Twitter feed block?==
This could be caused by many things. The best guess, would be that the installation process made some mistakes. For example, a MySQL, PHP or Apache setting or combination of settings were not configured correctly for the site. If it is a new site, it is probably better to not waste time on trying to find out which line in a config file needs to be changed, but first try and reinstall. Check your browser, is it IE7 or 8. Unfortunately, some releases of IE have trouble rendering Moodle styles easily, the complexity of a page may cause an error in IE and the internal error handlers just toss you back to the login page.


==How can I change a Block item name from a list inside a block?==
An HTML block can be used to display the latest tweets from any Twitter account. See [[HTML block]] for details.
You can change an item name in the Administration ►  Language ►  Language editing > Editing words and phrases tab. Select the 'moodle.php' file then search for the words you need to alter.


==See also==
==See also==


*Using Moodle [http://moodle.org/mod/forum/view.php?id=2121 Blocks forum]
*Using Moodle [http://moodle.org/mod/forum/view.php?id=2121 Blocks forum]
Using Moodle forum discussions:
*[http://moodle.org/mod/forum/discuss.php?d=195874 More problems with "Sticky" blocks in 2.2] with instructions on how to make blocks appear on all course pages


[[Category:FAQ]]
[[Category:FAQ]]


[[de:Bl%C3%B6cke_FAQ]]
[[de:Block_FAQ]]
[[es:Bloques FAQ]]

Latest revision as of 14:30, 8 September 2015

How do I hide front page blocks from non-logged-in users?

  1. Click the "Turn editing on" button at the top-right of the front page. (You need to be logged in as an administrator.)
  2. Click the assign roles icon (often a face and mask) in the header of the block to be hidden. (NOTE: Don't worry if you get an error message saying you are not able to assign roles ;) )
  3. Scroll down to the settings block and click the Permissions link
  4. Blockassign.png
  5. In the View block section, click the X next to Guest
  6. Click the "Save changes" button.

Alternatively, to hide all blocks from non-logged in users, you can go to Administration>Site administration>Users>Permissions>Define roles and edit the Guest role to disallow View block.

How do I show front page blocks to guests and hide them from logged in users?

  1. Click the "Turn editing on" button at the top-right of the front page. (You need to be logged in as an administrator.)
  2. Click the assign roles icon (in the header of the block to be hidden. (NOTE: Don't worry if you get an error message saying you are not able to assign roles ;) )
  3. Scroll down to the settings block and click the Permissions link
  4. Blockassign.png
  5. In the View block section, click the X next to authenticated user
  6. Click the "Save changes" button.

How do I get rid of a link in "Site Pages" in the Navigation block?

When a resource or activity (like a page, file or forum) is added to the Main menu block on the front page, it will appear in the Site Pages of the Navigation block. If you need the item but don't want it to display then go to Site administration>Appearance>Navigation and uncheck "show front page activities in the navigation". If you no longer want the item then turn on the editing on the front page, go to or add the Main menu block and click to delete the item.

How do I make a front page block visible to teachers but not students?

It is possible to control who sees block on the front page. The following applies to any specified group of people, not just teachers and students.

  1. Ensure you have hidden your block from non-logged in users as in the instructions above.
  2. In Administration>Site administration>Users>Permissions>Define roles, click on "authenticated user on the front page"
  3. In the context type, select "block"
  4. Set moodle/block:view to "allow". Save the changes.
  5. Turn editing on on your front page.
  6. Click the "assign roles " icon on your block.
  7. Click the blue words of "authenticated user on the front page" to access the screen where you can choose who you want to allow to see this block (such as your teachers) by moving them from the right hand box to the left.
  8. Now click "Permissions" in your block's Administration settings
  9. Click the X next to "authenticated user" to prevent them viewing this block.
  10. From now on, regular authenticated users will not be able to see the block. However, those who have been given the role of "authenticated user on the front page" will be able to see it.

How do I make a block in my course visible to teachers but not students?

Here are two suggestions:

1.Add a block to a page which only teachers can see, for example /grade/report/grader/index.php You could add a comments block for teachers to discuss and moderate each others' grades. Alternatively,you could add an HTML block to /badges/index.php with badge issuing policies. A block may also be added to enrol/users.php for notes or comments regarding enrolments.

2.Add a block to the main course page and ask your administrator to go to Block>Assign roles>Permissions and prevent authenticated users and students from viewing the block. (A regular teacher cannot change permissions of authenticated users.)

How can I change a Block item name from a list inside a block?

You can change an item name in Settings>Site Administration > Language> Language customization Select the 'moodle.php' file then search for the words you need to alter.

How to I make a block "sticky"?

See Block settings. Using the edit icon in the block heading, go to the configuration page. Look for the "Where this block appears" group and "Display on page types". Depending upon your current context and permissions, you will see different options. One maybe "All pages" or "Any type of course main page", and others.

Where did that block come from? I do not want it!

Your site administrator or some one with more permissions than you decided that block should be there. It is possible to force a block to appear on other pages. For example, a site administrator my force a HTML block on every main course page and determine where it will be, so they may put site messages there.

Your site administrator can tell where every instance of a block appears via Blocks administration.

How can I decide the order in which blocks are docked?

Blocks are "docked", from top to bottom (usually on the left) in the order in which you dock them.

How can I add a block to all user profile pages?

See User profiles for instructions.

How can I prevent users from adding blocks to their dashboard page?

See Dashboard for instructions.

The blocks have disappeared from the front page/course page!

This can sometimes be caused by users pasting from Microsoft Word which corrupts the formatting. See this forum post for more details https://moodle.org/mod/forum/discuss.php?d=217390#p958884

Help, I accidentally hid the administration block without realising the consequences!

  1. Go to http://yourmoodlesite.org/admin/blocks.php
  2. Unhide the administration block by clicking the closed eye icon opposite it

I accidentally deleted the navigation (or administration) block!

  1. Go to Administration > Site administration > Plugins > Blocks > Manage blocks (or via the URL http://yourmoodlesite.org/admin/blocks.php) and unprotect the navigation block by clicking the padlock icon
  2. Turn editing on in any course
  3. Go to the front page and use the 'Add a block' dropdown menu to add a navigation block there, setting it to display throughout the entire site
  4. Go back to Administration > Site administration > Plugins > Blocks > Manage blocks and re-protect the navigation block.

The above method works the same for the navigation and administration blocks.

My Administration block links don't expand!

This has been noticed as a Javascript problem. Given the many possible factors behind this issue, each situation is different. Please try to:

1. Use another browser or use another version of the same browser (try both, lower and higher versions).

2. Purge all cache (Administration > Development > Purge all caches): http://yoursite.com/admin/purgecaches.php

3. Change the Use slash arguments option at the HTTP page (Administration > Server > HTTP): http://yoursite.com/admin/settings.php?section=http

4. Try different settings at the AJAX and Javascript settings page (Administration > Appearance > AJAX and Javascript): http://yoursite.com/admin/settings.php?section=ajax

5. Turn off Javascript in your browser (the linked site shows how to enable Javascript, so do the opposite)

6. Turn off Java (you should have it disabled anyway, unless you really need it)

7. Try using another theme: http://yoursite.com/theme/index.php

8. If you are using the $CFG->httpswwwroot directive (for SSL login) at the config.php configuration file, try and comment it (add a double forward slash and a space "// " at the beginning of the line), like so:

// $CFG->httpswwwroot = etc.

9. At the Moodle config.php configuration file, add the following line to set the default time zone (please use the List of supported timezones):

date_default_timezone_set("valid-timezone");

For example, to set the time zone for Sofia, Bulgaria, add the following line:

date_default_timezone_set("Europe/Sofia");

Note. If possible, it would actually be better to add the time zone setting directive to the PHP php.ini configuration file (please see PHP Runtime configuration):

date.timezone valid-timezone

You should also:

1. Enable Debugging (Administration > Development > Debugging): http://yoursite.com/admin/settings.php?section=debugging, as this may provide possible useful information regarding the cause.

2. Check if your browser is showing some warning or error indications (watch the status bar).

For more details see any of the following forum threads https://moodle.org/mod/forum/discuss.php?d=269877#p1166200, https://moodle.org/mod/forum/discuss.php?d=166994 or https://moodle.org/mod/forum/discuss.php?d=200243 or the tracker MDL-31678.

How can I add a Twitter feed block?

An HTML block can be used to display the latest tweets from any Twitter account. See HTML block for details.

See also

Using Moodle forum discussions: