No Closing Tags

No Closing Tags

by RW Wood -
Number of replies: 8

I just discovered that moodle doesn't generate the closing body and html tags for most pages. I'm assuming that it's an oversight and that the tags would be in the footer.html file, however if that's the case, it's problematical when it comes to designing a theme where one might ant to more the links inside a division tag.The easiest way to do it is to just put the print_footer function call where you want the links to appear, nowever if the closing body and html tags were there, the code wouldn't render properly.

I checked serveral pages on the Moodle site and none of them showed the tags when I viewed the source.

Thought you should know.
RWW

Average of ratings: -
In reply to RW Wood

Re: No Closing Tags

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
I don't understand the problem. thoughtful

The footer.html file is always the last thing to be printed (why would you use print_footer() anywhere else?). You can add closing body and html tags to footer.html if you want them, and you can also can add whatever extra HTML code you want to. *shrug*
In reply to Martin Dougiamas

Re: No Closing Tags

by RW Wood -

The problem is, in order to be valid HTML, in order to comply with current standards, and in order to display properly in all browsers, the last thing on the page should be:

</body>
</html>

The current Moodle distribution leaves out those closing tags on most genertated pages. Granted, using the current out-of-the-box product, it's a simple matter to add them to the footer.html file (Since they should be there already, what was the motive in leaving them out?)

As to "why would you use print_footer() anywhere else?", any piece of html code is just that, and the more those pieces are free to be moved around within the framework of the page, the more the program is able to be customised to the individual site on which it's being used. In the themes forum, you indicated that you are working toward separation of content and design, and it would be a logical step in that direction to not have the $loggedinas and $home content tied to the closing body and html tags. Suppose, for example that I want the loggedinas string to appear at the top of the page beneath the banner or at the top of the right hand column. As Moodle now stands, that would take major code revision. Even to move the current footer.html content inside the bounding border on my site so that it's centered with respect to the center column and not with respect to the page would take considerable code change. (see http://every-nation.com/exam/ The site is being reworked toward total CSS definition, including the position of the columns. Try resizing the browser window and you'll see the benefit.)

No malice intended I assure you. Overall, Moodle is very well done in my estimation. I don't know PHP well enough to do more than hack other people's code, and my entire site relies on open source, so I appreciate your efforts. However, in the evolution of Moodle, there needs to be more separtation of content and design. As it stands, I won't be able to easily upgrade my site to the next version of moodle because I've made so many changes to the html within the files that I'd have to start all over again. That's the reason I suggested you take a look at ezPublish where php and html have been nearly completely separated. I thought you might get some ideas as to how to more effectively accomplish that task.

Sorry for the long post, but I wanted to explain my thinking.

Thanks again for Moodle, and good look with your thesis.
RWW

In reply to RW Wood

Re: No Closing Tags

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
Hi, RW.

I'm not sure I do quite see the benefit of CSS that you see (see attachment). clown

The issue you're now talking about is separation of content and design, which is a little different to the use of footer.html, and well covered here already. I agree fully with you that it needs to be done. The proposed changes using XSLT will mean a massive revamp of the whole display system, but will give total flexibility.

All I meant was (and my apologies if I sounded curt, the reply was dashed off in the middle of lots of other things) that in the current scheme, the footer.html and the print_footer function are named that because they are meant to be the page footer. smile

Your post seemed to be saying two opposing things. Firstly that you wanted the end tags, and secondly that you didn't want the end tags because you wanted to use print_footer in the middle of the page. I just meant that if you leave them at the end of the page there is no real problem. smile

You're right, leaving out the closing tags was an oversight, but not actually a problem as every single browser in existence will close these tags automatically upon encountering the end of a page. In any case, I will fix those missing tags in the next release, so thanks for bringing them to my attention.

I'm sorry about your customisations causing upgrade problems, but you may want to give some thought to the idea of making a tasty cake first (ie online course), then adding icing (CSS) afterwards ...

Regards,
Martin
Attachment instituto_bliblico_mozilla.png
In reply to Martin Dougiamas

Re: No Closing Tags

by RW Wood -

With respect to the fact that Mozilla doesn't display the page properly, I should have indicated that I'm far from done. Getting "stuff" to validate when it's built on such a large scale is not so easy as a single page, so that's a way off. Check the page in IE6 where it currently doesn't break, to see what I'm getting at.

As to the "icing vs. cake" issue, the courses are ready, but I'm not going to serve them until they're frosted. smile

Thanks.
RWW

In reply to RW Wood

Re: No Closing Tags

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
homermmm.gif
"Mmmmm ... Moodle cake" smile
In reply to Martin Dougiamas

Re: No Closing Tags

by RW Wood -

The cake still isn't totally done, but I believe the problem you saw viewing the site in Mozilla is corrected. At least it looks ok in NN6.

On another note, as I indicated, I'm trying to rework the code for CSS and HTML validation, and I came across an oddity I can't seem to backtrack. If you do a view source of your home page, at the end of the meta description (derived from the right column on the front page) there is a closing tag that needs to be escaped for xhtml compliance, only I can't find where that code is comeing from.

Any help would be appreciated.
Thanks.
RWW

In reply to RW Wood

Re: No Closing Tags

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
The description is passed to header.html via a call to print_header() in moodle/index.php.

Front page looks better in Mozilla - still some problems with course listing (see attachment).
Attachment courselist.jpg
In reply to Martin Dougiamas

Re: No Closing Tags

by RW Wood -

By "problems", I'm assuming that you mean that not all the info that should be displayed is showing. I haven't finished going through the site to set CSS classes for all the text, etc, and have been first working on getting pages to validate. In reality, all the info is there on the page for which you included the .jpg, but doesn't show because of it being the same color as the table cell.

Thanks.
RWW