Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37677

Re: Getting Topic Number in the Body Tag

$
0
0
by Jason Hardin.  

When you say on that page you are referring to the course being configured to display one section per page? And the menu will highlight that topic when the user is within that topic only?

This feature didn't exist before Moodle 2.4. Clarifying this would be useful.

Does this process need to work for any course format? 

I would focus on 2 global variables $PAGE and $COURSE. I have never looked if either has information about the currently selected topic. If they do your theme can add the tag back into the body with:

<body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $newclass)) ?>">

I would focus on the $PAGE variable first. We did something similar to what you are talking about with the Flexpage course format but as a block not part of the theme.

 


Viewing all articles
Browse latest Browse all 37677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>