Overview
The Lesson/Topic Grid module is part of the Pro Suite of modules for the Uncanny LearnDash Toolkit. It’s much like the Enhanced Course Grid module, except that it displays lessons or topics instead of courses.
Shortcode/Block
[uo_lessons_topics_grid]
Block Name: Enhanced Lesson/Topic Grid
The lesson/topic grid can be added to any page to display a grid of lessons or topics. If the shortcode/block is added to a course page, it will automatically display the lessons in that course. Similarly if the shortcode/block is added to a lesson page, it will automatically display the topics in that lesson. With no additional parameters, it will display a 2-column grid of lessons/topics (featured images of equal sizes should be added to lessons/topics). Dripped lessons that are not yet available will display their availability date.
Use of the shortcode/block on a course or lesson page will hide any quizzes associated with that lesson or topic. You will need to manually link to any associated quizzes. Note: If the grid is enabled globally on all lessons and/or topics (see below), the quiz table will still be displayed.
Enabling globally on all lessons and/or topics
If you want to show a grid of lessons and/or topics on all course and lesson pages, the grid can be enabled globally from the module settings box.
Attributes
The [uo_lessons_topics_grid] shortcode includes a few attributes to keep things as flexible as possible. Here’s a list of the attributes that are currently available:
Attribute Name | Description | Attribute Values | Default Value |
---|---|---|---|
course_id | Specify a course ID to display lessons from; attribute is required if the shortcode is not placed on a course page. Cannot be used with lesson_id | any course ID | If placed on a course page, the ID of that course |
lesson_id | Specify a lesson ID to display topics from; cannot be used with course_id. Can only be used on LearnDash pages; topic grid is not supported on non-LearnDash pages. | any lesson ID | If placed on a lesson page, the ID of that lesson |
category | Specify a WordPress category to display lessons/topics from that category only. Cannot be used with tag attribute | any category slug | "all" |
tag | Specify a lesson/topic tag to display lessons/topics with that tag only. Cannot be used with category attribute | any tag slug | "all" |
cols | Sets the number of columns to display per row. | "1", "2", "3", "4", or "5" | "2" |
show_image | Controls whether or not course featured images are displayed. If no featured images are set for courses, this should be "no". Note when uploading a featured image, WordPress will automatically crop it to 1.33:1 aspect ratio. The image you upload should be at least 624 x 468 pixels. Note that there is a global setting to enable images, so if no images are showing in your grid, make sure images aren't turned off in the module settings. | "yes" or "no" | "yes" |
border_hover | Changes the border colour of grid items when they are hovered over. |
Using CSS to Customize the Lesson/Topic Grid
You can customize the grid layout directly in a CSS file rather than using shortcodes by copying the following file:
/wp-content/plugins/uncanny-toolkit-pro/src/assets/legacy/frontend/css/lesson-topic-grid-view.css
Move it to your child theme so that it’s available at:
/wp-content/themes/your-theme/uncanny-toolkit-pro/css/lesson-topic-grid-view.css
Overriding the Lesson/Topic Grid template
Update: As of Uncanny LearnDash Toolkit Pro version 3.1, you can edit files in an upgrade-safe way using overrides. Copy the template into a directory within your theme named /uncanny-toolkit/, keeping the same file structure but removing the /templates/ subdirectory.
For example, to override the lesson/topic grid template, copy:
wp-content/plugins/uncanny-toolkit-pro/src/templates/lesson-topic-grid.php
to
wp-content/themes/yourtheme/uncanny-toolkit/lesson-topic-grid.php
The copied file will now override the default template in the Uncanny Toolkit.
Warning: Do not edit these files within the the Uncanny Toolkit plugin itself, as they are overwritten during the upgrade process and any customizations will be lost.
The Category and Tag attributes don’t work.
Hi, the usual issue here is confusing between LearnDash categories and tags and WordPress categories and tags. If you can open a support ticket with a screenshot of your edit categories (or tags) page, along with the shortcode you’re using, it will help us identify what’s happening. Usually though it’s an issue with the attribute used for categories and tags and the type (WordPess vs. LearnDash).
How would I modify this to show Learndash Sections?
Sorry Adrian, sections aren’t something we currently support in this module, but we are assessing it as a possible feature request in future.