Changes in columns

Changes in columns

by Alexei Soukhoverkhov -
Number of replies: 13

Dear colleagues,

 

I am going to make my own theme to include Moodle as a part of my education and training site. The idea is that I would like to delete the right column and to move the content to the left one.

As far as I see the final page is made in index.php. Am I right? Have anybody seen a template for the last version  Moodle of this kind to start with?

 

Thanks in advance

 

Alexei

Average of ratings: -
In reply to Alexei Soukhoverkhov

Re: Changes in columns

by Jit San Chia -
A simple solution maybe to just move all the blocks from the right to the left, and there you have it, a 2-column page instead of 3
In reply to Jit San Chia

Re: Changes in columns

by Alexei Soukhoverkhov -

That's what I am going to do. But the question is how to move. As far as I know the front page is divided into 3 columns in index.php. Am I right? Or there is any other way to move it?

 

Is it possible somehow to change html/css components with no changes in php? If there is any way to achieve it, it is better to leave the code unchanged (as a standard of separating a theme from a program)… Could you give a peace of advice for the beginner?

In reply to Alexei Soukhoverkhov

Re: Changes in columns

by Andrew King -
#right-column{
display:none!important;
}
Copy that into your CSS.

But you will need to move every module across from the right column before you add this code, as you won't be able to do it afterwards (because you can't see the column).

Also, whenever you create a new course, it will put all of the default modules into both columns. So when you add a new course, you would need to switch themes and then move everything across, and then switch back.

Hope it helps.

In reply to Andrew King

Re: Changes in columns

by Patrick Malley -
Rather than going through the hassle of switching themes just to get at your right column, try this in addition to the CSS mentioned above.

.editing #right-column {
display: block;
}

This will allow access to the right column with editing turned on.

Oh, and the !important in above post is unnecessary.
In reply to Alexei Soukhoverkhov

Re: Changes in columns

by Patrick Malley -
Turn editing on and move the blocks using the arrows that will appear.

Or, use CSS as mentioned elsewhere in this thread.
In reply to Patrick Malley

Re: Changes in columns

by Alexei Soukhoverkhov -

Thanks everybody for the advices. I see that I have to learn more about using Moodle first of all. I am new to the script.

 

But you see, as far as I am concern, I am able to move columns while entering courses. But I guess that my friends teachers should not think about such things if I invite them to write education programs. It is my responsibility to make the site work comfortable for them…

 

So is there any way not to close the right column but delete it at all? Just to make some file that is responsible for page formation to put all data to the left side?

 

Do anybody know what file is responsible for it? Does it use php?

In reply to Alexei Soukhoverkhov

Re: Changes in columns

by Andrew King -
In my opinion it is best to do as much as you can with CSS before you revert to changing the PHP.

However, the functionality that you are trying to achieve does involve the deletion of some PHP. We got around it by using a script on the server that automatically populates new courses with specific blocks, and prevents anything from being moved to the left column.

I'm afraid that I can't offer the script that we used as that side of things is handled by our eProjects Manager, and I don't know where I would find it.

However, I'm sure that someone here will be able to help.

On a side note, it is best practice to remove the left column and leave the right one, not the other way around. This is due to accessibility issues as well as readability concerns.
In reply to Andrew King

Re: Changes in columns

by Alexei Soukhoverkhov -

Thank you for your attention to my question. The thing is that I am not looking for any pre-made decision for my design. I am going to do it myself. But the only thing is to get an advice what files are responsible for it. Just not to study the structure from the very beginning.

 

Yes, there is a reason to make navigation on the right side. But as far as I am concerned, I have a ready made portal already which consists of several parts already (we are a training company but we also have a job-site, a site for publications, internet shop, forum and much more). In the nearest future we are starting a new project in e-learning. And the thing is that I do not  create a new site. I am going to ad a part to the existing one.

 

More than that, I think that it is a good idea to make a two column version for Moodle society because of two reasons. First there some attempts to do something like this in existing themes (but the problem, basically, is not solved). And the second is that all sites are mostly looks like each other by structure. It’s a good idea to make something different that show the flexibility of the script.

In reply to Alexei Soukhoverkhov

Re: Changes in columns

by Mauno Korpelainen -

Alexei,

you may as well test editing index.php. In current moodle versions there are still three td tags:

id="left-column"
id="middle-column"
id="right-column"

Try for example

blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);

inside td left-column to get blocks from both sides to the left side (front page only). However moodle has several course formats and if you check for example

course/format/topics/format.php

you should find a same kind of a structure for course topic format...

In reply to Alexei Soukhoverkhov

Re: Changes in columns

by Elena Ivanova -
You can also use Sticky Blocks get all blocks to the right side (but this will mean that all sites on your installation will have those blocks) - http://docs.moodle.org/en/Sticky_blocks

In reply to Elena Ivanova

Re: Changes in columns

by Alexei Soukhoverkhov -

I am new to php but I’ve found it! It is very e asy to make the script to place new blocks to the left column. There is a special procedure settled in a function in ..lib directory. I do not remember already but something like pagelib.php or something like that. This functions are responsible for block formation and default placement. All I needed was to change the word right to left. I a m new to php a nd English is not my n a tur a l l a ngue. I just guess that this is called CLASSES in php. Am I right? If I am than php is as easy that it was possible to catch the bases in 3 days reading manuals smile

In reply to Alexei Soukhoverkhov

Re: Changes in columns

by Alexei Soukhoverkhov -

Dear collegues,

Are there any php-gugu among us? Could you help me with php syntax? I am trying to change the color of a single link (all others are colored as it is stated in my css file).

The thing I have to do is just to write 

<http://www.link.com style=”colore#FFFFFF” “>The link</a>

I have found the code I need to change. Here it is (from weblib.php):

$realuserinfo = " [<a $CFG->frametarget
            href=\"$CFG->wwwroot/course/loginas.php?id=$course->id&amp;return=1&amp;sesskey=".sesskey()."\">$fullname</a>] ";

here is what I’ve done – but it is wrong
           $realuserinfo = " [<a $CFG->frametarget
            href=\"$CFG->wwwroot/course/loginas.php?id=$course->id&amp;return=1&amp;sesskey=".sesskey()."\. style=\"color:#FFFFFF\"">$fullname</a>] ";

Where are my mistakes? I can not get it (and I am new to php)

In reply to Alexei Soukhoverkhov

Re: Changes in columns

by Mauno Korpelainen -

Usually style is at the beginning ( now there is ."\"> at the end of first link tag and style is inside it - that \ is needed before " to print " so that outer "..." tags are not broken )

Links should look like

 <a style="color: #ffffff" href="The address">The address</a>

Try

$realuserinfo = " [<a style=\"color: #ffffff\" $CFG->frametarget
            href=\"$CFG->wwwroot/course/loginas.php?id=$course->id&amp;return=1&amp;sesskey=".sesskey()."\.">$fullname</a>] ";