Skip to content

Conversation

@rjekic
Copy link

@rjekic rjekic commented Jul 11, 2025

I've added a course duration field and made it part of the sidebar meta fields block. I am aware that there is a Learning Duration block already created (I used part of the code from that block), but if we add that block to the single course template, it will be displayed even if the duration meta field in the course settings sidebar is not populated.

@jonathanbossenger @devmuhib009

@jonathanbossenger
Copy link
Collaborator

if we add that block to the single course template, it will be displayed even if the duration meta field in the course settings sidebar is not populated.

I hope you don't mind my asking, but I'm interested in understanding the use case for having a fallback. Why would we not just use the Duration in hours field?

@rjekic
Copy link
Author

rjekic commented Jul 14, 2025

@jonathanbossenger

In my previous comment, I was comparing the difference between using the Learning Duration block (which we are currently using) and the code I added in this PR. Both of them are using data from the Duration in hours field; however, if the field is not populated, the block will still be visible on the frontend, and the code I added in the PR will not be visible in that specific case.

Copy link

@Successfulsebunya Successfulsebunya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done. Thank you @rjekic

Copy link
Member

@theaminuli theaminuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is ready to be merged and the code is good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants