current section highlight

current section highlight

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

Out of the dozen or so themes provided with current Moodle 2.0 Preview, only 2 provide CSS highlight for current section: arialist and formfactor.

As a regular user of this feature in my Moodle courses, I find this lack rather strange. Could please all theme creators provide a highlight setting for currrent section.approve

Joseph


Attachment image00.jpg
Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: current section highlight

by Patrick Malley -
I'll have a look, Joseph.

MDL-23236
In reply to Joseph Rézeau

Re: current section highlight

by Tyler Burton -

Dear Joseph, 

I'm currently trying to implement a fix to a custom block I've programmed to have it highlight the current section. Can you tell me if there's any actions required to see the current section highlight? I've tried arialist and formfactor and neither show any highlights for me.

I will gladly publish the block code once finished.

Best,
Tyler Burton 

 

In reply to Tyler Burton

Re: current section highlight

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Tyler,

When you say custom block, is it coded into a theme, or is it a plugin?

Where exactly is the section you want to highlight?

The section Joseph is talking about, in this old discussion, is in the course page. If your block is in a course page, then without knowing if it has any class or id selectors attributed to it, it's hard to tell you how to style it.

HTH

Mary

In reply to Mary Evans

Re: current section highlight

by Tyler Burton -

Hi Mary,

I built a modified block based on the Section Links block. In the php I see mention of a "highlight" method and am wondering how to test if that's working as I can't even get my current section to highlight.

Does that make more sense? 
Also, thanks for the quick reply on this ages-old thread...! big grin

Best,
Tyler 

PS - I'm using Moodle for the first time. More of a Wordpresser. So maybe this is an obvious SNAFU.

In reply to Tyler Burton

Re: current section highlight

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I started off Wordpressing...then I discovered Moodle and made my first Moodle (1.9.7) theme based on a Wordpress theme (Japan style). It was a steep learning curve!

OK...back to you custom Block.

I did not know about the 'section link'  block...so I have just been playing with it. The highlight in the php $highlight refers to the course topic section or weekly section, in the center of the course page.  If you turn editing ON you get to see a light bulb, which, if you click it, 'highlights' that section. This is what Joseph was refering to in this earlier discussion.

So if you had Section 3 highlighted in that course page. When you look at the Section Links block it has all the section numbers listed (topic sections are numbered). Under the numbers it says, "Jump to current section*. This 'current section' is the one which is highlighted. So clicking on 'Jump to current section' moves Section 3 to the top of the page. A bit like you get with Bookmarks on a web page.

So really there is nothing for you to 'highlight' in your block unless you have added something.  Also...blocks don't have stylesheets so I guess they are just funcional objects on a page and rely on the theme to style them.

Hope this makes sense?

Cheers

Mary

Average of ratings: Useful (1)
In reply to Mary Evans

Re: current section highlight

by Tyler Burton -

Mary, 

Thanks for the tip on what the highlighting means. Being new to the Moodle interface and getting a grip on its PHP has left me a bit dazed generally.

Unfortunately, the highlighting was for the course ID. I'm trying to pull down the current section number and convert that so when my modified section blocks runs through the numsections function for "i" if "i == $currentsection" I want to change its class. I've got the class change parameter working this->course->id but stuck on how to make the current section number available to the same function?

Any help is appreciated. Perhaps just a clue as how to print available variables on screen even?

Many thanks,

Tyler