Check if it's class

Check if it's class

by Daniel Henriquez -
Number of replies: 2

Hi guys!


How i can check if it's class to show some features in course view?


Thanks for help!

Attachment bad.JPG
Attachment ok.jpg
Average of ratings: -
In reply to Daniel Henriquez

Re: Check if it's class

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Not sure what the issue you're asking about is.

The first image looks like the user dashboard page - therefore the header is showing the user name. The second image looks like its from a course page and the header is therefore showing the course details.

Isn't that what should happen? What do you want different to that? Bearing in mind that if you are on a user dashboard page, you are not in a course and so by definition you can't show course details.

In reply to Daniel Henriquez

Re: Check if it's class

by Michael Aherne -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

If you're looking to check from code what kind of page you're on, you want $PAGE->pagetype. I think it's "course-view" for those pages.