Page Titles for Content Pages

Page Titles for Content Pages

by Matt Fedorko -
Number of replies: 13

Hello, all!

We just updated to Moodle 2.0 over the weekend and one thing I was really pleased about was the way that the individual pages (content pages, that is -- formerly branch tables) looked like in Lessons. Unfortunately, when I edited one of these pages, it changed the format and I can't figure out how to get it back to how it was before!

I have uploaded a screenshot that shoes a page pre-edit and what it looks like post edit.

Notice that the Page Title appears embedded in a black box around the content of the page before I edit the page. I like this.

After I edit the page -- and it forces me into adding something in the "Description*" box under "Content 1" -- it looks like the bottom. The Page Title is suddenly formatted exactly like the title of the lesson, and the black border disappears.

Is this an issue with the theme or the Lesson system?

Thanks all.

Attachment Pre-and-Post-Edit.jpg
Average of ratings: -
In reply to Matt Fedorko

Re: Page Titles for Content Pages

by Matt Fedorko -

Also, if any of you want to answer the same question for a different problem, be my guest. The question is: Lesson's fault or theme's fault?

The problem is when I look at the Edit tab in a lesson, Expanded view, all of the text is centered on the pages. When I look at each page individually, they appear properly -- left justified or right justified or whatever.

In reply to Matt Fedorko

Re: Page Titles for Content Pages

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

Hi Matt,

I do not quite understand your problem. Since you ask whether one should blame the theme, it would be useful if you told us which theme you are actually using!

Joseph

In reply to Joseph Rézeau

Re: Page Titles for Content Pages

by Matt Fedorko -

Well...I have two problems! But let me say that one of our computer guys took a day to transition the theme we built for 1.9 (which was originally Cornflower) to 2.0 (which he built from the Base theme).

I have two problems. The first, as illustrated by the image above, is that after upgrading to 2.0, the formatting given to the content pages in my lessons was great -- a black box around the content, the title of the page embedded into that black border. It looks great. However! When I edit each content page for the first time, two things occur. First, it demands I put in something in the box that says "Description*" in the section "Content 1." Second, when I save my changes, whatever they are, the formatting of the content page changes. Now, instead of placing the content page title in a black box around the content, it shows the content page title in the same format as the Lesson title (green underline).

I would like to keep the formatting that was there initially, but do not know why it would change at all.

 

The pictures above may be confusing, because it is showing two different content pages, but the bottom one looked like the top, formatting wise, before I edited it.

In reply to Matt Fedorko

Re: Page Titles for Content Pages

by Matt Fedorko -

Okay, I apologize for posting so much, but here's some more screenshots illustrating the problem I'm having. Once again, this is a Content Page inside a Lesson that has not been touched since we upgraded to 2.0. The first image I will post is of what this page looks like at this point. This is inside Internet Explorer, Moodle 2.0, Base theme.

 

Attachment PreEdit.jpg
In reply to Matt Fedorko

Re: Page Titles for Content Pages

by Matt Fedorko -

Here is a screenshot of the ONLY edit I made to this page, putting the word "Continue" into the "Description*" box under "Content 1." I made NO OTHER CHANGES to this page. To get there I had clicked "Edit the Contents of this Page" and then typed "Continue" into that box, then clicked "Save."

Attachment TheEdit.jpg
In reply to Matt Fedorko

Re: Page Titles for Content Pages

by Matt Fedorko -

This is what the page looks like AFTER I clicked Save, then returned to the Preview of that page. Notice that, as in the example all of the way at the top of this page, the CONTENT PAGE TITLE ("Solar Declination") is now formatted exactly like the LESSON TITLE itself ("Module 2: Knowing the Sun Path." Also, the black border disappears. It is not as it was originally, in the first of these three images I posted.

Again, I would like to maintain the original formatting -- I LIKE the black border around that box, and I LIKE the Content Page title inside the border. Again, also, this problem is seen in both my theme (modified from BASE) and the BASE theme.

Again, also, I am really sorry for posting so much, but I want to make myself understood in order to get help. Thank you for your time.

Attachment PostEdit.jpg
In reply to Matt Fedorko

Re: Page Titles for Content Pages

by Itamar Tzadok -

I don't know why the original formatting happens but I can see why it would be "reset" upon updating the page.

You may find it useful to know that the title formatting you like is typically done by

<fieldset>
<legend>title goes here</legend>

... content goes here ...

</fieldset>

So one way to get the effect is to add these tags and the title to the page content and hide the actual Page title by css.

Alternatively you can hack the module and add those tags to the module's php/html.

There may be other ways to get the effect but none that I can think of right now. smile

In reply to Matt Fedorko

Re: Page Titles for Content Pages

by Chris Collman -
Picture of Documentation writers

Matt,

Did you see if it behaved the same way in Firefox or Opera ?  I have not played with a 2.0 theme (yet), but in the past IE  has had some version files in the CSS schema.

This does not rule out some annoying code that is changing something.   Did you view page source before and after?   That sometimes gives me a clue about issues (as I often say, I bang my head against the wall until I find a door or something works, I am not an expert) and where they might come from.

I agree with Itamar, logically a pre and post edit change in the layout does not make sense.

After looking at view page source, Just for fun have you tried to force the course or category theme to one or the other to see if that has an impact?

Whew, interesting.  I am guessing this is really a theme issue but I will keep it here in the meantime smile

Chris

In reply to Chris Collman

Re: Page Titles for Content Pages

by Mike Holzer -

Hi Chris,

I'm working with Matt on this issue. It's not directly related to the themes, because it happens in every theme. Somewhere in the code it's actually swapping the display formatting.

What is happeining is that unedited content is displayed within a fieldset. As soon as you edit it, it is no longer placed inside a fieldset, and the "lesson title" is placed inside an H2 element, with the class of "main". This is the same class used for the Module title and it looks odd because there are no additional classes used on the content.

As I said, this is the case in every theme that comes with the default Moodle 2 install.

-Mike

In reply to Mike Holzer

Re: Page Titles for Content Pages

by Chris Collman -
Picture of Documentation writers

Hi Mike,

Better you than me.     Thanks for your efforts and the explaination, it may help others.  I see just a peak of dawn over Marblehead.  smile   Chris

In reply to Chris Collman

Re: Page Titles for Content Pages

by Matt Fedorko -

Chris,

After looking extensively through the types of pages you can create in Moodle 2.0, it seems that the formatting is consistent across them. In the case of our theme (built from the Base theme), there is

  1. A title for the whole object (the name of the Lesson for instance, or just the title of the Page if it's a webpage resource. This, in our case, is centered and above a hard return. It is also green for us (to differentiate it from the regular black of the content). It is also bold and slightly larger.
  2. Then there's the title of a page within that object (so the title of a Question Page inside a Lesson, or the title of a Content page inside a Lesson) that appears left justified and inside a border. It is bold, but black and the same size as the content, I think.
  3. Finally, there's a 1px roughly box around the content of the page itself.

I am convinced that the Content Pages inside Lessons were intended to have the formatting I've outline above (in our theme they look like that, but I'm talking about the hierarchical relationship between #1 and #2 mainly. In this error, it seems that after we edit each page the hierarchy disappears and it makes titles that should look like situation #2 look like situation #1.

Again, if I'm making myself understood, I don't mean to say that every theme should look the same, but that there is a difference in formatting between 'BIG TITLE,' 'Smaller Title,' and 'content' that's being erroneously erased.

I believe this is a bug and should be entered into the tracker. Of course, I don't know how to do this! smile

In reply to Chris Collman

Re: Page Titles for Content Pages

by Matt Fedorko -

I have verified that it has this same behavior in Google Chrome. I believe Mike uses Firefox, and he's seeing it as well. I have seen it in 4 different themes, and am confident it is not a theme issue. It may be a migration issue, however, and that each time I edit a page in a lesson it's "fixing it" by making the formatting what it was supposed to be post-migration.

Visually speaking, I don't think each Page Title of a Lesson is supposed to be formatted in the same was as the Lesson Title itself -- that's not very hierarchical, or visually pleasing. Plus, the Question Pages are formatted like the pre-edit pages (box around them, in this theme, title embedded in the border) and when you edit them, they stay like that.

In reply to Matt Fedorko

Re: Page Titles for Content Pages

by Matt Fedorko -

I have moved the problem about the expanded edit page formatting to a separate thread. Thank you.