Issue Details (XML | Word | Printable)

Key: MDL-8327
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Martin Dougiamas
Reporter: Urs Hunkler
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

moved column width settings from the index.php/format.php files to theme/config.php - more flexible

Created: 28/Jan/07 05:15 AM   Updated: 11/Jun/07 03:07 PM
Component/s: Blocks
Affects Version/s: 1.8
Fix Version/s: 1.8.2

Participants: Martin Dougiamas and Urs Hunkler
Security Level: None
Resolved date: 11/Jun/07
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE


 Description  « Hide
Struggeling with overlapping text in some sideblocks and with different side column width.

One solution is to change the width range of the side columns in the theme config.

Changes in index.php and /topics/format.php:
// Bounds for block widths
// more flexible for theme designers taken from theme config.php
$lmin = (empty($THEME->block_l_min_width)) ? 160 : $THEME->block_l_min_width;
$lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
$rmin = (empty($THEME->block_r_min_width)) ? 160 : $THEME->block_r_min_width;
$rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;

define('BLOCK_L_MIN_WIDTH', $lmin);
define('BLOCK_L_MAX_WIDTH', $lmax);
define('BLOCK_R_MIN_WIDTH', $rmin);
define('BLOCK_R_MAX_WIDTH', $rmax);

changes in theme/config.php:
$THEME->block_l_min_width = 100;
$THEME->block_l_max_width = 210;
$THEME->block_r_min_width = 100;
$THEME->block_r_max_width = 210;;

/// These values define the min and max width of the left and right
/// sieblocks in the course pages. If not set or false the standard
/// values are taken.

Martin, are there any reasons agains defining the sidecolumn width in the theme config.php?



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Martin Dougiamas added a comment - 28/Jan/07 09:42 PM
The main issue here is that blocks can all have different widths, and the column needs to adjust to fit the largest one (on the fly) because we don't know in advance which blocks teachers will use.

I faintly remember problems with blocks getting squished down when they shouldn't be.

Jon's solution was to allow all blocks to specify a minimum/maximum width, and the page class calculates the column widths from these.

That said, I can't see any problem with doing what you did to place a bit more control over the defaults in the theme config files.


Urs Hunkler added a comment - 07/Feb/07 04:37 AM
I added the neccessary code to all course formats, the index.php and admin/pagelib.php.

Urs Hunkler added a comment - 11/Jun/07 03:07 PM
The code is in Moodle since version 1.8 and is working.