In ver. 2.3 you can not change section name for section 0

In ver. 2.3 you can not change section name for section 0

by Bente Olsen -
Number of replies: 16
Picture of Testers Picture of Translators

In Moodle 2.2 you could give the first section of a course in topic format a name. It is still possible to apply a name in ver 2.3, but even if you turn off 'Use default section name' it is not displayed. The topic description is shown as expected. This must be a bug in Moodle 2.3?

Edit: The new section name is displayed in the navigation block.

Average of ratings: -
In reply to Bente Olsen

Re: In ver. 2.3 you can not change section name for section 0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Bente,

You are right, I think that there is a possible coding fault if this is not the intent.  To see what I mean, edit /course/format/renderer.php and change line 649 in the function print_multiple_section_page from:

echo $this->section_header($thissection, $course, true);

to

echo $this->section_header($thissection, $course, false);

I think a tracker issue is in order - thoughts?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: In ver. 2.3 you can not change section name for section 0

by Dan Poltawski -
I think this bug is reported as MDL-33767, though I am not certain it is the same issue.
In reply to Dan Poltawski

Re: In ver. 2.3 you can not change section name for section 0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Dan,

Looking at the second test on the tracker issue, this is identical to performing step 1 on section 0 and then failing step 2 when it is not displayed.  Looking at the patch (both for Moodle 2.3 and master) for /course/format/renderer.php, line 648/649 this should solve the issue.

Cheers,

Gareth

In reply to Bente Olsen

Re: In ver. 2.3 you can not change section name for section 0

by Lynn Harvey -

Am using Moodle 2.3.1 (20120802)

and now have issues with section name which we wish to have blank

using OneTopic format

The word Introduction appears in the section 0 and we wish to have in the tab but not in the section.  Luckily, the section name for subsequent sections appears in the tab only.

section name

 

And now, when using Topic Format, there appears to be no way of hiding the words Topic 1, or having that area blank, in the section.

sn2

Any ideas?

In reply to Lynn Harvey

Re: In ver. 2.3 you can not change section name for section 0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Lynn,

Please replace the existing 'renderer.php' in the format with the attached.  That should do what you want it to do.  I've also fixed a bug when first using with a new course - I downloaded the latest version from the plugins database.

Of course, test on a non-production site first.  If this works, please request that David (creator on plugins database) does an update and credits me with the change.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: In ver. 2.3 you can not change section name for section 0

by Lynn Harvey -

Thanks Gareth, that worked for OneTopic Format, it is no longer showing the Section Name in Section 0.

Any ideas how to hide the Section Names in Topic format?

In reply to Lynn Harvey

Re: In ver. 2.3 you can not change section name for section 0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Lynn,

Yes I do, the '/course/format/topics/renderer.php' needs to be changed in a similar way to the OneTopic format.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: In ver. 2.3 you can not change section name for section 0

by Mindy Workman -

Gareth,


I feel as though I'm stalking you on these forums wink

Can you please clarify the following:

'the '/course/format/topics/renderer.php' needs to be changed in a similar way to the OneTopic format.'

I have looked through each renderer.php file, and made a few trial and error changes (usually resulting in the whole course becoming invisible...). Any help would be greatly appreciated!

Thank you!

Mindy

In reply to Mindy Workman

Re: In ver. 2.3 you can not change section name for section 0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Mindy,

Sorry, I've lost the plot on this exact thread.  So, are you trying to prevent the output of all section names or just section 0 in the Topics format?  And in what mode 'One section per page' or 'Multiple sections per page'?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: In ver. 2.3 you can not change section name for section 0

by Echol Marshall -

I just put a couple of spaces in the place where one enters the topic name, and viola!  no topic name!

I only did that so that I could create large font, color, etc for the topic "name."

Average of ratings: Useful (1)
In reply to Mindy Workman

Re: In ver. 2.3 you can not change section name for section 0

by Leonard Houx -

Somehow, I'm having the opposite problem using the onetopic format: I can only display the section name in section zero.

It is not clear why this is doing this since the code (lines 289-291) for displaying the header reads:

// The requested section page.
            $thissection = $sections[$displaysection];
            echo $this->section_header($thissection, $course, true);

In reply to Leonard Houx

Re: In ver. 2.3 you can not change section name for section 0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Leonard,

As this thread is over a year old, please could you clarify what version of Moodle and One Topic you are using.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: In ver. 2.3 you can not change section name for section 0

by Leonard Houx -

Hi Gareth Sorry. Bad form on my part.

I am using Moodle 2.3.7+ (Build: 20130614).

The version of Onetopic I am using is 'Guarango' version 2012062605.

I actually changed

echo $this->section_header($thissection, $course, true);

to

echo $this->section_header($thissection, $course, false);

And now I am getting titles (albeit linked). I also am really not expert enough in PHP to know what I'm doing.

In reply to Leonard Houx

Re: In ver. 2.3 you can not change section name for section 0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Leonard,

Thank you - I'll look at it as soon as I can.

Cheers,

Gareth

In reply to Leonard Houx

Re: In ver. 2.3 you can not change section name for section 0

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Leonard,

I just tested with Moodle 2.3.7+ (Build: 20130627) and Onetopic 'Guarango' version 2012062605 without any changes and 'Topic 0' is behaving exactly the same as 'Topic 1' etc. regarding the name.

So what is the problem please?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: In ver. 2.3 you can not change section name for section 0

by Leonard Houx -

Thanks for looking at this. Perhaps I should note that I have been using Onetopic in 'Show all sections on one page' mode. I got no titles except section 0 until I set:

echo $this->section_header($thissection, $course, true);

to

echo $this->section_header($thissection, $course, false);

But those titles appear as links. Which isn't a big problem, but, in context, doesn't make sense.