Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add class to the current lesson in the Course Syllabus block #2777

Closed
brianhogg opened this issue Oct 21, 2024 · 2 comments
Closed

Add class to the current lesson in the Course Syllabus block #2777

brianhogg opened this issue Oct 21, 2024 · 2 comments
Assignees

Comments

@brianhogg
Copy link
Contributor

Is your feature request related to a problem? Please describe.
In older themes, using the Course Syllabus widget would add a current-lesson class on the current lesson. This lets the lesson be styled (ie. bolded) to show the student what lesson they are on. In the newer Course Syllabus block however this class (or a similar class) is not added.

Describe the solution you'd like
Add a CSS class on the div for the lesson.

Describe alternatives you've considered
There is a llms_get_preview_classes filter we could possibly use, which only passes in the $classes already generated currently. Or, creating a custom version of the lesson-preview.php template.

@ideadude ideadude moved this to Awaiting Triage in Development Oct 21, 2024
@ideadude ideadude self-assigned this Oct 21, 2024
@brianhogg brianhogg assigned brianhogg and unassigned ideadude Oct 21, 2024
@brianhogg
Copy link
Contributor Author

For some reason the global $post is the Course rather than the Lesson when the course syllabus is generating, so you can't do a if ( get_the_ID() === $this->get( 'id' ) ) within the LLMS_Lesson::get_preview_classes method.

@github-project-automation github-project-automation bot moved this from Awaiting Triage to Done in Development Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants
@brianhogg @ideadude and others