Problem/Motivation
Custom Paragraph content does not display on the lesson page of a course.
Steps to reproduce
- Create a custom paragraph to be elegible
- Modifiy the page paragraph type
- Modifiy the reference field
- Modifiy the reference field
- The paragraph then becomes elegible in your lesson
- It looks like it works...
- But it doesn't...
Maybe There's something I'm not doing. If so... I'd appreciate some enlightenment. Thanks in advance!
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Step-7.gif | 35.63 KB | ledjerdemain |
| #3 | Step-6.gif | 20.76 KB | ledjerdemain |
| #3 | Step-5.gif | 49.29 KB | ledjerdemain |
| #3 | Step-4.gif | 16.88 KB | ledjerdemain |
| #3 | Step-3.gif | 22.59 KB | ledjerdemain |
Issue fork anu_lms-3331125
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ledjerdemain commentedComment #3
ledjerdemain commentedComment #4
spleshkaHi @ledjerdemain, great question! Basically, you've got all right. The only thing is that paragraphs are rendered via React application, and in order to display your added paragraph in the lesson, you need to create a custom React component. Would you need some help in getting this done? I can draft some guidance if you feel comfortable rendering your custom paragraph with React.
Comment #5
ledjerdemain commentedHello @spleshka. Thank you for your answer! And because I am an absolute noob... yes I would need some help getting this done. If there is however any documentation you could point me too, I'd gladly check it out! Thanks a lot again!
Comment #6
spleshkaHey, I'm sorry it's taking so long to update the documentation. It's still on our TODO list.
Comment #7
ledjerdemain commented@Spleshka I get, these things take time. But I am very much looking forward to it.
Comment #8
dastan56 commented@Spleshka hi, i am trying to override one of the anu lms react component in my custom module react, but everytime i try to import using following code:
import ParagraphsWithQuiz from '@anu/components/ParagraphsWithQuiz.js';
i get the following error, when i run npm run build:
Module not found: Error: Can't resolve '@anu/components/ParagraphsWithQuiz.js'
i see in the readme file you have written TODO. Untill you update the documentation, can you give me a quick idea here on how to get it done so that i can continue with my work, thanks
Comment #10
spleshkaI've created a MR with an example of how to override the existing component (addressing #8). An example of how to add a new custom paragraph is yet to be added to the same MR.
Comment #11
spleshkaHi @ledjerdemain, we've finally had some time to add an example of how to add a custom paragraph type to Anu LMS: https://git.drupalcode.org/issue/anu_lms-3331125/-/tree/3331125-cant-add.... Hopefully you'll find it helpful :-)
Comment #13
spleshkaMerged examples into the main branch. Added documentation to https://www.drupal.org/docs/contributed-modules/anu-lms/customising-anu-lms. Happy to mark the issue as fixed!