Removing Topic Numbers

Removing Topic Numbers

by Matt Softly -
Number of replies: 10

This may have been touched on before, but I have just removed the Topic Number that appears in Topic View (e.g. 1,2,3)

If you have found that you would rather just use topic headings, without the use of numbers, then this can easily be amended:

located the topics.php file in your moodle directory (see below)

Either
moodle/course/topics.php
or
moodle/course/formats/topics.php

Open this file for editing, and scroll down to the middle of the document. Look for the entry below for guidance.

/// Now all the normal modules by topic
/// Everything below uses "section" terminology - each "section" is a topic.

Move down the code, until you get to the following block:

echo "<tr>";
echo "<td nowrap $colorsides valign=top width=20>";
echo "<p align=center><font size=3><b>$section</b></font></p>";
echo "</td>";

All we need to do is "comment-out" one line, so that the block now looks like this:

echo "<tr>";
echo "<td nowrap $colorsides valign=top width=20>";
// echo "<p align=center><font size=3><b>$section</b></font></p>";
echo "</td>";

Save the file, and hey presto - your Topics no longer have numbers!

To reverse the effect, just uncomment the one line.

 

Note - if you upgrade Moodle to a new version, or use the CVS code, then you will have to manually change this file again - or maybe this could be implemented into a future version of Moodle?

 

Matt Softly

Average of ratings: -
In reply to Matt Softly

Re: Removing Topic Numbers

by Tony Parke -

Hi Matt,

I cannot find topics.php in version 1.5.4, is the code to be amended in another file on the more recent versions?

 

Regards,
Tony

In reply to Tony Parke

Re: Removing Topic Numbers

by Heather P -
Did you find the code. Did you succeed in turning the topic box numbers off?
We have Moodle 1.5.2 and I think I'm in the right file but I can't find the line it says to comment out and hence can't comment it.
If you succeeded in turning the numbers off how did you do it if you don't mind me asking.
Thanks
Heather
In reply to Matt Softly

Re: Removing Topic Numbers

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
If you don't want (or are not allowed) to hack your Moodle code, I am giving a pure CSS solution which you can apply in your theme here.
Joseph
Average of ratings: Useful (1)
In reply to Matt Softly

Re: Removing Topic Numbers

by Art Lader -
if you upgrade Moodle to a new version, or use the CVS code, then you will have to manually change this file again - or maybe this could be implemented into a future version of Moodle?

Good suggestion, Matt. You might want to addit to the bug tracker.

Best regards,
Art
In reply to Matt Softly

Re: Removing Topic Numbers

by Heather P -
Hi
we recently upgraded from 1.5.2 to version 1.8.1 and now I can't find this code to edit.
We want to turn the topic box numbers off again.
I tried the file moodle\course\format\topics\format.php but the code seems to have changed and I can't find the line listed above to comment out.

Has anyone managed to turn topic box numbers off in version 1.8.1? If so how please?
Thanks
In reply to Heather P

Re: Removing Topic Numbers

by Roger Emery -
Hi,

Easy Answer:-
in moodle/course/topics/format.php change line 204 (on Moodle 1.8.2 that is)

from this: echo '<td class="left side">'.$section.'</td>';
to this: echo '<td class="left side"></td>';

you just remove the section number variable.

However....
I've created a new format called "Topics - No numbers" which can be selected in the settings on the normal drop down list so tutors have the choice. Some teach in weekly format, but don't want dates, but do want week numbers so they can use normal topics format. But some don't want dates or numbers.

How?

1. on the server in directory moodle/course/format/
make a duplicate copy of the 'topics' folder and all its contents and rename it (I used 'yourformat' as in the readme)

2. In 'yourformat' folder change line 204 in the format.php file as above

3. in the directory moodle/lang/en_utf8/moodle.php
edit the moodle.php language file to add these two lines:

$string['nameyourformat'] = 'topic';
$string['formatyourformat'] = 'Topics format - no numbers';


and thats it.smile

Roger



Average of ratings: Useful (1)
In reply to Roger Emery

Re: Removing Topic Numbers

by Jennifer Sheppard -
Hi Roger,

I performed all of the actions you define above for creating a new course format. I do see the new course format in my drop-down list (Course Settings page); however, when I save the settings it converts my format to LAMS. Do you have any idea of what may be the issue.

Thanks,
Jennifer
In reply to Jennifer Sheppard

Re: Removing Topic Numbers

by d morte -
I'm having this same problem in 1.9.7 - everything goes fine, but the format kicks back to LAMS