How align the block title

How align the block title

by abadi SAELM -
Number of replies: 10

Hello for everyone .

I want to ask some questions :

How to align the title of a block to the right ?

How to change the names of the links or subjects in the block .

How to align these links to the right .

Happy to join you .

Average of ratings: -
In reply to abadi SAELM

Re: How align the block title

by Mahmoud Kassaei -
You set the variable title ($this->title) in the function init() to a string which can be alighned.

For the content (your links for instance), you set the contect ($this->content->text) in the function get_content() to a string which can also be aligned (e.g. in a css).

I hope it helps.

In reply to Mahmoud Kassaei

Re: How align the block title

by abadi SAELM -
Thanks for the replay .

But where do I change these ?

which file and which folder ?!

Sorry but I am very new to moodle.



In reply to Mahmoud Kassaei

Re: How align the block title

by Dan Stark -
Hello!
How do I do this and where do you find this solution in the multiple php pages and scripts????

I too want to change the label name called "courses" to a label name of "profiles" ..

Dont care about changing the centering, linking or other.. all else remains the same.... Do not want to change anything about linking or function.. just want to change the label name in the front page block called "courses" ( in the colored heading area on the front page of moodle to ... "Profiles"
See at http://lifeandstory.net/moodle/

Trying to adapt moodle for something a little different...

All help will be appreciated...
In reply to Dan Stark

Re: How align the block title

by Mahmoud Kassaei -
Hi Abadi, Dan,
in the top (moodle) directory, there is a directory called blocks and under bloacks there are directories for each block.

For instance, in function init() in moodle/block/course_list/block_course_list.php the line
$this->title = get_string('courses');
refers to the title of the block courses. The function get_string('courses') indicates that the string 'courses' coming from a language file and I think it is coming from the file moodle/lang/en_utf8/moodle.php. You could change the line:

$string['courses'] = 'Courses';
to
$string['courses'] = 'Profiles';

or add a line to this file as follows:
$string['profiles'] = 'Profiles';
and modify the line
$this->title = get_string('courses');
as
$this->title = get_string('profiles');
in
moodle/block/course_list/block_course_list.php

I hope this would help.

Mahmoud
In reply to Mahmoud Kassaei

Re: How align the block title

by Dan Stark -
Here is what I did.. but it seemed to have no effect...
Was very careful to make sure the change was saved and replaced old php file.. and yet it did nothing.. Did I miss something?
Thank You for helping...

<?PHP //$Id: block_course_list.php,v 1.29.2.1 2006/10/21 16:30:23 moodler Exp $

include_once($CFG->dirroot . '/course/lib.php');

class block_course_list extends block_list {
function init() {
$string['profiles'] = 'Profiles';
$this->title = get_string('profiles');
//$this->title = get_string('courses');
$this->version = 2004111600;
}

function has_config() {
return true;
In reply to Dan Stark

Re: How align the block title

by Mahmoud Kassaei -
Your modification is correct apart from the line
$string['profiles'] = 'Profiles';
which needs to be added to to the language file ../lang/en_utf8/moodle.php and not to the function init() in the block.

In reply to Mahmoud Kassaei

Re: How align the block title

by Dan Stark -

Thanks to all for your kind attention to this problem..

Well... I found time to try again.. here is what I did

1. Step 1...

<?PHP //$Id: block_course_list.php,v 1.29.2.1 2006/10/21 16:30:23 moodler Exp $

include_once($CFG->dirroot . '/course/lib.php');

class block_course_list extends block_list {
 function init() {
 //$this->title = get_string('courses');
$this->title = get_string('Profiles');
 $this->version = 2004111600;
 }

 function has_config() {
 return true;
 }

_________________________________
Step 2. In the /lang/en_utf8/moodle.php area
//$string['course'] = 'Course';
$string['course'] = 'Profiles';

Results in nothing changing with the title / label.. has no effect..
So I changed
//$string['course'] = 'Course';
$string['course'] = 'Profiles';
in the block_course_list.php area... No effect..

I am not sure what I am not doing right ..but tis is not working
Thank You for helping..

Any other suggestions??? for changing the block label "courses to "profiles"?
see at http://www.lifeandstory.com/moodle/

--------------------------------------------------------
In reply to Dan Stark

Re: How align the block title

by Mahmoud Kassaei -
try changing the version from

$this->version = 2004111600;
to
$this->version = 2007032300;

and hit the admin page

In reply to Dan Stark

Re: How align the block title

by Nathanael Klassen -

Step 1 is not needed if you want to change the word 'Courses' to 'Profiles' everywhere it is used in Moodle. You can change the function back to...

class block_course_list extends block_list {
function init() {
$this->title = get_string('courses');
$this->version = 2004111600;
}

Notice that it says get_string('courses') not get_string('course'). That means in Step 2 you need to change string['courses'] not string['course']. In lang/en_utf8/moodle.php set 

string['courses'] = 'Profiles'

and it should work.

If you want to only change the block, not other instances where the word 'Courses' might be used, then keep your changes in Step 1 and add the line

string['Profiles'] = 'Profiles' 

to lang/en_utf8/moodle.php.

Also there is a language file for the Course List block in /lang/en_utf8/block_course_list.php. This file has a $string['blockname'] that is equal to 'Course List'. I'm not sure where (if?) that string is used, but you could try changing it as well.

Hope this helps.

Nathanael