Course Theme Overrides Internally Linked Webpage?

Course Theme Overrides Internally Linked Webpage?

by Frank Fucile -
Number of replies: 16
Hello there...not sure if this is a bug...but i have never noticed this before but after we upraded to Moodle 1.9.7+ (Build: 20100106)

For all linked webpages the course theme overrides any style that you have applied to the webpage...

Here is a screen shot that illustrates what is happening - http://www.screencast.com/users/fucci/folders/Jing/media/521ca3d4-21f9-4414-8dd1-c5ce657c2714

Any help or insight would be much appreciated

cheers
frank
Average of ratings: -
In reply to Frank Fucile

Re: Course Theme Overrides Internally Linked Webpage?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Frank,

Could you give me some more information so that I can try and mimic the problem you are facing? Which pages have you linked? Do these linked pages have their own theme or just the default for your particular theme?

I'm in the process of testing the ability to have different course themes, so far I haven't hit on anything like you are describing.

BTW I can't see your screen-shot - the image does not seem to want to load!

Mary
In reply to Mary Evans

Re: Course Theme Overrides Internally Linked Webpage?

by Frank Fucile -
Hey Mary...thanks for helping out...

I have attached a the blank html file that I uploaded to the course...

...but once i upload the blank html to the Files area and you view it...as you can see from the screen shot Moodle inserts the style sheet of the the present course theme?

Here is another link to the screenshot - http://screencast.com/t/YTU5ZWE2ZD

cheers
frank

In reply to Frank Fucile

Re: Course Theme Overrides Internally Linked Webpage?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Frank,

Thanks for the new screenshot and the htm file.

Another question.

What method did you use to upload the file to a course?

I just tried uploading your html file to a course on my Moodle site, and now all I get when I try to click on the link to the file is a message asking me to download it...in effect it's forcing a download of the page. Obviously you have something different on your site.

Mary
In reply to Frank Fucile

Re: Course Theme Overrides Internally Linked Webpage?

by Itamar Tzadok -
...but once i upload the blank html to the Files area and you view it...as you can see from the screen shot Moodle inserts the style sheet of the the present course theme?

It seems to me that the blank file seems to have the theme background simply because it has a default transparent background which reveals the background of the window in which it opens which has the theme background because this window opens as a moodle page. Hope this makes sense. smile
In reply to Itamar Tzadok

Re: Course Theme Overrides Internally Linked Webpage?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Nice try, Itamar, but see my explanation below...wink
Joseph
In reply to Joseph Rézeau

Re: Course Theme Overrides Internally Linked Webpage?

by Itamar Tzadok -
It's all about trying. At any rate, for any immediate practical matter my explanation is as good as yours despite being wrong (or perhaps it is right but very awkwardly phrased, if you want to be charitable, that is wink). Interestingly enough, that's one of the characteristics of technology in general. One may design something based on mistaken assumptions about reality, and it will still work. Indeed there may be a point where mistaken assumptions will clash with reality. These clashes may even be inevitable. So we should always strive to get the right assumptions before we hit the wall, and help from friends is always welcome. In the mean time we should keep trying. Does that make sense? smile
In reply to Itamar Tzadok

Re: Course Theme Overrides Internally Linked Webpage?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Dear Itamar,

By using the "nice try" expression and adding a smiley I was hoping to be charitable (rather than being in my too-frequent sarcastic mood with which you are familiar in my postsblack eye).

I quite take your point that "the proof of the pudding is in the eating", which does not apply only to technology but many other domains of everyday life. The only reason that my explanation is better than yours (but you may disagree) is not that it is based on a correct view of reality whereas yours is maybe based on a mistaken assumption. It is better because it gives one working solution to the problem (not the only one, but one which works).

When I read your explanation about "the theme background [which ] has a default transparent background which reveals the background of the window in which it opens" I did try to make sense of it, I experimented with various CSS properties in the OP's start_here_01_welcome_v.htm HTLM page but couldn't reach a solution ... until I looked into the Wood theme stylesheet to find out that it set its body as:

body {
background-color:#CC9966;
background-image:url(background.jpg);
}

After all, that HTML page is not "transparent" and showing the wood pattern under it, it is on the contrary quite opaque, since it inherits from the Wood theme the wooden patttern.

In conclusion, I have to admit that I probably would not have suggested a solution to the OP if you had not piqued my curiosity by providing an explanation which clashed with my perception of reality and forced me to try to find a different way of explaining things. For that I am grateful (and I hope the OP will, toowink).

Joseph

In reply to Joseph Rézeau

Re: Course Theme Overrides Internally Linked Webpage?

by Itamar Tzadok -
Your explanation was definitely more useful than mine simply because it offered clear guidelines for solving the problem and my post didn't and in itself was quite fuzzy. But let me try to explain the transparency concept.

Without a specific background definition most html elements are transparent in the sense that you can see through them underlying layers all the way to the html tag (exclude buttons and their ilk). The html tag is assigned a default background color by the browser so it isn't transparent. You can change that color in the browser's options. For instance, you can set the browser's default background color to blue in which case opening start_here_01_welcome_v.htm directly in the browser will display the page and the text "plain web page" on a blue background. Of course adding definitions to the page will override definitions in a prior level. Moodle overrides the browser's definitions by applying definitions to the html file upon opening. Adding definitions to the file will override the Moodle theme definitions.

I hope my explanation of the background reality of html tags is now more transparent. wink
In reply to Itamar Tzadok

Re: Course Theme Overrides Internally Linked Webpage?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
smile Listening to you two talking makes me smile! This is something I enjoyed on another forum years ago when I first started surfing the web. It's surprising how much one can learn, so thanks for both your comments, and informative banter!

I'm still puzzled, however, since I cannot find a way to upload the html document, and link to it, without the file wanting to download all the time! I could FTP it directly up to the server I suppose, but that would defeat the object of testing this, so called 'problem', if indeed it is a problem.

I did wonder why it was Frank used such a basic page, and one without its own stylesheet too. Very odd. Like Joseph, and yourself, Itamar, I too saw that the HTML page, without any styles, would revert to the default of the theme in anycase.

Cheers

Mary
In reply to Itamar Tzadok

Re: Course Theme Overrides Internally Linked Webpage?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Itamar:

I hope my explanation of the background reality of html tags is now more transparent.

Well, it retains just enough opacity to make sense. Thanks for continuing to enrich our understanding of the arcanes of HTML, CSS and all that.

Reminds me of a passage in my PhD thesis where I discussed the concepts of transparency and visibility in the context of ICT. I found the following reference quite useful then: Processes of mediation by Daniel Chandler.

ATB

Joseph
In reply to Joseph Rézeau

Re: Course Theme Overrides Internally Linked Webpage?

by Frank Fucile -
Hello to all...thanks for your help...

yes, what I didn't know was that the Moodle theme overrides the webpage if it doesn't have it's own css, etc...

I used a basic web page and the wood theme only as an example/demo...most of the instructors i work with create very simple web pages without css, etc...

But now that i know the 'trick' i can pass that information onto my instructors

cheers
frank

In reply to Frank Fucile

Re: Course Theme Overrides Internally Linked Webpage?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
No, Frank, the uploaded HTML page's own CSS (inline or attached stylesheet) does override the current Moodle theme' CSS.
However, for the over-ride to appear, your uploaded HTML's CSS must contain CSS rules which override those rules in the current Moodle CSS theme.
For instance, since your start_here_01_welcome_v.htm web page does not contain or refer to any CSS stylesheet of its own, it will follow the current moodle theme's CSS.
Actually, the interaction between the moodle theme's CSS and your own CSS for uploaded HTML pages can be quite tricky to control.
I see that you are using the "Wood" theme (which I personally find terribly outdated and pretty horrible, but that's a matter of personale taste wink).
That theme puts a picture of wood surface as the background of its html pages. If you want your uploaded HTML pages to not display that "woody" background, you must add a specific CSS rule, and this is for example what your start_here_01_welcome_v.htm web page should look like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Welcome!</title>
<style type="text/css">
body {
background-color: #FFF;
background-image: none;
}
</style>
<body>
plain web page
</body>
</html>
Attachment image00.jpg
In reply to Joseph Rézeau

Re: Course Theme Overrides Internally Linked Webpage?

by Patrick Bourne -
Hi all,

Going off on a potential tangent here (and might mean I should have started a new post), but I'm trying to get themes to attach themselves to a HTML page not made in Moodle - kind of like using the issue first raised in this post but as an intentional plan.

To clarify:
We are offering the course to schools that would each like their own theme logo. No problem for Moodle itself, but I am using a lot of external HTML pages (with javascript and all linked from a main template in Dreamweaver). I would like for these webpages to be able to pick up on whatever theme the student is on and reproduce the relevant header.

Is there any coding I can put in the external HTML pages that will 'read' and apply the current theme?

Would love any input smile

Thanks

Patrick
In reply to Patrick Bourne

Re: Course Theme Overrides Internally Linked Webpage?

by Patrick Bourne -
Sorry - should have added that I have tried linking to a file with frames and without, but it creates a double scrollbar and takes up too much real estate on the screen.

Cheers

Patrick
In reply to Patrick Bourne

Re: Course Theme Overrides Internally Linked Webpage?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Read this thread then get back to me if you think it may solve your problem!
http://moodle.org/mod/forum/discuss.php?d=147935
In reply to Mary Evans

Re: Course Theme Overrides Internally Linked Webpage?

by Patrick Bourne -
Hi Mary,

Thanks for the link - this is definitely something I had overlooked and will be very helpful for future set ups, but what I'm ideally looking for is something that will 'write' the header logo onto external HTML pages. The session theme does the job perfectly for any resource written in Moodle, but there are so many pages that Dreamweaver templates workbest (and allow more scripting) for the majority of pages.

Thanks very much for the session themes idea though smile

All the best,

Patrick