<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mkh</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mkh"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/Special:Contributions/Mkh"/>
	<updated>2026-08-11T11:29:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Block_layout&amp;diff=41141</id>
		<title>Block layout</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Block_layout&amp;diff=41141"/>
		<updated>2008-08-01T13:40:38Z</updated>

		<summary type="html">&lt;p&gt;Mkh: /* Default block layout for new courses */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Default block layout for new courses==&lt;br /&gt;
&lt;br /&gt;
[[Sticky blocks]] may be used in Moodle 1.6.&lt;br /&gt;
&lt;br /&gt;
Alternatively, to amend the default block layout for new courses (in all versions of Moodle), add one or more of the following lines (omitting the forward slashes) to &#039;&#039;config.php&#039;&#039; and amend the block names as required.&lt;br /&gt;
&lt;br /&gt;
Note how the colon is used to separate those blocks appearing on the left, from those appearing on the right.&lt;br /&gt;
&lt;br /&gt;
 // These variables define DEFAULT block variables for new courses&lt;br /&gt;
 // If this one is set it overrides all others and is the only one used.&lt;br /&gt;
 //      $CFG-&amp;gt;defaultblocks_override =    &#039;participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity&#039;;&lt;br /&gt;
 //&lt;br /&gt;
 // These variables define the specific settings for defined course formats.&lt;br /&gt;
 // They override any settings defined in the formats own config file.&lt;br /&gt;
 //      $CFG-&amp;gt;defaultblocks_site = &#039;site_main_menu,admin,course_list:course_summary,calendar_month&#039;;&lt;br /&gt;
 //      $CFG-&amp;gt;defaultblocks_social =  &#039;participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,admin,course_list&#039;;&lt;br /&gt;
 //      $CFG-&amp;gt;defaultblocks_topics =  &#039;participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity&#039;;&lt;br /&gt;
 //      $CFG-&amp;gt;defaultblocks_weeks =  &#039;participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity&#039;;&lt;br /&gt;
 // These blocks are used when no other default setting is found.&lt;br /&gt;
 //      $CFG-&amp;gt;defaultblocks = &#039;participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
(code copied from &#039;&#039;config-dist.php&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
==Resetting the block layout for existing courses==&lt;br /&gt;
&lt;br /&gt;
The block layout for existing courses may be reset by copying the following script into a text file, saving it as &#039;&#039;resetblocks.php&#039;&#039;, copying it into the Moodle root directory, then visiting &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yourmoodlesite.org/resetblocks.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please note that a database backup is recommended before using the script. ;-)&lt;br /&gt;
 &amp;lt;?php&lt;br /&gt;
 require_once(&#039;config.php&#039;);&lt;br /&gt;
 require_once($CFG-&amp;gt;libdir.&#039;/blocklib.php&#039;);&lt;br /&gt;
 $courses = get_records(&#039;course&#039;);&lt;br /&gt;
 foreach($courses as $course) {&lt;br /&gt;
    $page = page_create_object(PAGE_COURSE_VIEW, $course-&amp;gt;id);&lt;br /&gt;
    blocks_repopulate_page($page);&lt;br /&gt;
 }&lt;br /&gt;
 print_heading(&#039;Done!&#039;);&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
Using Moodle [http://moodle.org/mod/forum/discuss.php?d=98808 Default Block Layout for moodle 1.9] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Block]]&lt;br /&gt;
[[ja:ブロックレイアウト]]&lt;/div&gt;</summary>
		<author><name>Mkh</name></author>
	</entry>
</feed>