Framesetting moodle

Framesetting moodle

by Ray Namajuska -
Number of replies: 12

Hi

I've created a frameset header that calls moodle. Works OK except when creating a resource linking to a webpage I loose my original frameset. Can anybody tell me how I can overcome this problem.

Thanks

Ray

Average of ratings: -
In reply to Ray Namajuska

Re: Framesetting moodle

by Greg Barnett -
I think that this is going to take some coding in Moodle. I've been thinking of trying something like setting up

$CFG->moodle_frame = '_top'

in config-dist.php, and then changing all of the _top targets in moodle to use the config value instead. Since only a small minority of moodle users put moodle inside of a frame, the ones that do could edit their config.php to have a $CFG->moodle_frame value appropriate to their needs. However, I haven't had the time to try this out.

For right now, the way I've been dealing with this on my site is to add a link back to the frameset that contains moodle in moodle/theme/mytheme/header.html
In reply to Greg Barnett

Re: Framesetting moodle

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Sounds OK to me - go for it! (I think it would be better to put the config in the config table, though, not config.php)
In reply to Martin Dougiamas

Re: Framesetting moodle

by Greg Barnett -
I'm not entirely sure of the process for adding something to the config table, so I put it in config-dist, with a commit message pointing out that it should get moved to the config table.
In reply to Greg Barnett

Adding a new config variable to Moodle

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
It's now in the config table (as 'framename').

For future reference the way to add config variables is to:

- pick a name (eg framename)
- add a new entry in lib/defaults.php
- add a new row in admin/config.html
- add a new info string "configframename" to lang/en/moodle.php
- increment version.php

Visiting the admin page will now install the new variable (and send you to the config page to check the setting for it).

Some day the whole config.html page will be rationalised into a nicer GUI with tabs or something.

As a side note, the current March 12 nightly seems to be pretty stable if someone wants to test the frame support Greg put in.
In reply to Greg Barnett

Re: Framesetting moodle

by Ray Namajuska -

Thanks Greg

I'll try using my own theme and creating the frameset in the header.html as suggested. Hope it works.

Thanx

 

In reply to Ray Namajuska

Re: Framesetting moodle

by Greg Barnett -
I think there might be a slight misunderstanding. I'm not creating the frameset in header.html, only linking to it. I've attached a sample screenshot that may make it more clear.
Attachment frame_screen_shot.gif
In reply to Greg Barnett

Re: Framesetting moodle

by Ray Namajuska -

I've created my own theme and placed images and links in header.html. I've stored my images folder in the root directory of moodle.

On entering moodle all is fine but when moving around the site, say in resources for instance all the image links are gone. Do I have to make a config change to point to the images folder? If so what would the command be

Any ideas - please help I'm very new to this but think its a great product

Thanks

In reply to Ray Namajuska

Re: Framesetting moodle

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Make sure you use full URLs to images in the header.html file.
In reply to Martin Dougiamas

Re: Framesetting moodle

by Ray Namajuska -

Thanks Martin. Have managed to frameset OK and am using the $CFG->wwwroot where the image folder is stored for the frameset.

Thanks for reply

In reply to Ray Namajuska

Re: Framesetting moodle

by John Gone -
Hi Ray,
I've been following your discussion about framesets with interest and was wondering if you would be willing to show us an example of what you've done? It sounds interesting, any chance of letting us have a look when you've got one ready for display? Please advise,
Thanks John
In reply to John Gone

Re: Framesetting moodle

by Ray Namajuska -

Hi John

I first created a new folder calling it mytheme and copied the contents of the standard theme folder into it.

I placed my html code which was to be my frameset in header.html in two places both after the if statements. I'll paste the original header.html and just mark where to put your own html code in. I hope I've explained myself, if not just email me and I'll see if I can describe it a bit better

I also made a change in mod/resource/lib changing the depth of the frame header

$RESOURCE_FRAME_SIZE = 130;

In my case I changed it to 220 to avoid the header from scrolling

Heres the header.html with "where you put your html coded" in red

<HTML<?=$direction?>>

<HEAD>

<TITLE><?=$title ?></TITLE>

<META NAME="keywords" CONTENT="Moodle, <?=$title ?> ">

<?=$meta ?>

<LINK REL="stylesheet" TYPE="text/css" HREF="<?=$styles ?>">

<LINK REL="SHORTCUT ICON" HREF="<?=$CFG->wwwroot?>/theme/standard/favicon.ico">

<? include("$CFG->javascript"); ?>

</HEAD>

<BODY <? if ($focus) { echo "setfocus()"; } echo " bgcolor=\"$THEME->body\">"; ?>

<? if ($home) { // This is what gets printed on the home page only ?>

******* PUT YOUR HTML CODE IN HERE WITHIN A <TABLE> ********

<TABLE WIDTH=100% CELLPADDING=10 CELLSPACING=0 BORDER=0>

<TR>

<TD VALIGN=TOP><FONT SIZE=4><B><?=$heading?></B></FONT></TD>

<TD ALIGN=RIGHT VALIGN=TOP><?=$menu ?></TD>

</TR>

</TABLE>

 

<? } else if ($heading) { // This is what gets printed on any other page with a heading ?>

********** REPEAT THE SAME HTML CODE IN HERE ********************

<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>

<TR>

<TD VALIGN=TOP><FONT SIZE=4><B><?=$heading?></B></FONT></TD>

<TD ALIGN=RIGHT VALIGN=TOP><?=$menu ?></TD>

</TR>

</TABLE>

<? } ?>

 

<? if ($navigation) { // This is the navigation table with breadcrumbs ?>

<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 WIDTH=100%>

<TR>

<TD BGCOLOR="<?=$THEME->cellheading?>" CLASS="navbar">

<FONT SIZE=2><B><? print_navigation("$navigation"); ?></B></FONT>

</TD>

<TD BGCOLOR="<?=$THEME->cellheading?>" CLASS="navbar" ALIGN=RIGHT WIDTH=20 VALIGN=TOP><?=$button ?></TD>

</TR>

</TABLE>

<IMG SRC="<?=$CFG->wwwroot?>/pix/spacer.gif" ALT="" HEIGHT=5 WIDTH=1><BR>

<? } else if ($heading) { // If no navigation, but a heading, then print a line ?>

<HR SIZE=1 NOSHADE>

<? } ?>

<!-- END OF HEADER -->

 

Hope this helps

Regards

Ray

In reply to Ray Namajuska

Re: Framesetting moodle

by John Gone -
Thanks Ray,
I'll try this and let you know how I made out.
You've made it easy by supplying this detail.
Thanks, John