Issue Details (XML | Word | Printable)

Key: MDL-11697
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Petr Skoda
Reporter: Andrea Bicciolo
Votes: 2
Watchers: 1
Operations

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

Blocks width not respected when showing blocks on resources pages

Created: 10/Oct/07 08:14 PM   Updated: 17/Aug/09 11:12 PM
Return to search
Component/s: Resource
Affects Version/s: 1.8.2
Fix Version/s: None

Database: Any
Participants: Andrea Bicciolo, Eleanor Martin and Petr Skoda
Security Level: None
Affected Branches: MOODLE_18_STABLE


 Description  « Hide
The problem mostly appears when using custom sized blocks and custom themes. To reproduce:

0. in admin, enable "showbloksonmodpages"
1. create a custom theme (or edit a standard one), and add the following lines to the theme's config.php

$THEME->block_l_min_width = 210;
$THEME->block_l_max_width = 210;
$THEME->block_r_min_width = 210;
$THEME->block_r_max_width = 210;

2. now show a course home page: blocks are resized to 210 pixel width, according to the above directives
3. add a web page resource and select "show blocks"
4. when Moodle shows the resource, the blocks are truncated at 180 pixel width

Possible solutions:
1. avoid hard coding the blocks pixel width, leaving it as CSS responsibility
2. modify line 191 of mod/resource/lib.php (code below) allowing the the code to keep into consideration the specified block width in theme's config.php
    $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);





 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eleanor Martin added a comment - 17/Aug/09 11:12 PM
I'd prefer the first option outlined - it makes much more sense to leave this as CSS on the class rather than hard-coding.