Don't display Topic 0 when displaying single topic

Don't display Topic 0 when displaying single topic

by Robert Phair -
Number of replies: 4

Dear Community:

I can't find how to suppress the display of Topic 0 (by default for news forums and/or a course “preamble”) when only a single topic is being displayed (i.e., when one clicks a rectangle box link “Show only topic N”).

We've installed the menu_site_and_course block, which is working wonderfully, but it's an impediment to the student to have to read the course preamble over and over again every time they click directly into a topic. When people are previewing the course, though, it’s important that they see the preamble when the display mode is “Show all topics.”

On our Moodle 1.9 server: In the code for <moodle>/course/format/topics/format.php there's an if statement in the section entitled Print Section 0 which prints/suppresses the preamble. But I don't know how to set up this condition since I can't find where the "summary" and "sequence" fields are set up... can someone please point me in the right direction, or perhaps let me know if there's a canonical way of doing this (i.e., without hacking the course format code)?

Many thanks, Robert

Average of ratings: Useful (1)
In reply to Robert Phair

Re: Don't display Topic 0 when displaying single topic

by Steve Hyndman -

Why not just delete the news forum (make sure the latest news block in not showing so it won't be added back) and don't put anything in topic 0. If you have nothing there, then it won't show...(it shows when you have editing turned on, but other than that it doesn't show). Then use Topic 1 for your preamble and start your other content in topic 2.

If you want to use your news forum, then just move it to topic 1.

Steve

In reply to Steve Hyndman

Re: Don't display Topic 0 when displaying single topic

by Robert Phair -
Hi Steve:

Our course is organised into five sections, specifically, whose numbers need to match another classification of the material (five basic Office applications, a la an ECDL/ICDL course). It wouldn't do to have these numbered 2 through 6.

The code suggests that the change I describe could be made with a minor modification to the code, such as changing the condition in the if statement that displays the preamble. I just don't know what the fields in the section structure mean, or where they are set (e.g., $thissection->summary or $thissection->sequence).

Perhaps somebody could answer this latter question if they don't want to provide an answer directly... if so I will post an answer to this forum as soon as I achieve one.

cheers, Robert

Average of ratings: Useful (1)
In reply to Robert Phair

Re: Don't display Topic 0 when displaying single topic

by Steve Hyndman -

Okay...I thought you wanted a solution that didn't involve hacking the code. I'm not sure how to change the code to only show section 0 when the topics are not collapsed. I'm sure this would be possible, but it may not be real simple keeping in mind that each user controls the collapsing/expanding of topics.

Maybe someone can help you figure this out, but in the mean time, if the topic numbers are a problem, you could still do what I explained above and then just remove the display of the topic numbers by editing the css...search for how to do that here in the forums. In fact, I do that on my main teaching site so that the topic numbers don't conflict with my module numbers...see example below.

In reply to Steve Hyndman

Re: Don't display Topic 0 when displaying single topic

by Robert Phair -
Thanks to everybody who responded. For simplicity's sake we've decided to put the course preamble in the course description so it displays on the Front Page only, and left Topic 0 empty.

best regards, Robert
Average of ratings: Useful (1)