Button in a Personality Quiz?
Submitted by Referred on Wed, 02/28/2018 - 12:06
Forums:
Hi guys,
I want to add a button in a Personality > Description field of my personality quiz. The reason i want to do this is because i want to redirect the user of the quiz to the most relevant page for him/her.
How can i do this? I've tried standard HTML but i can't get it to work...
Thanks alot :-).
Yannick
BV52
Thu, 03/01/2018 - 02:54
Permalink
Hi Yannick,This is possible
Hi Yannick,
This is possible by making changes to the code. A good place to start is this documentation.
-BV52
Referred
Thu, 03/01/2018 - 09:07
Permalink
Thanks for your response.
Thanks for your response. Which documentation do you mean?
BV52
Thu, 03/01/2018 - 09:10
Permalink
Sorry about that. Here's the
Sorry about that. Here's the link :-)
-BV52
Referred
Thu, 03/01/2018 - 16:38
Permalink
I've tried adding these
I've tried adding these instructions: https://h5p.org/adding-text-editor-buttons but i still can't see a WYSIWYG editor or the ability to add a button... Any way you can help me out perhaps?
otacke
Thu, 03/01/2018 - 17:05
Permalink
Hi!Thanks for reaching out.
Hi!
Thanks for reaching out. It's hard to tell what went wrong if there's no way to see the code that you have actually used. Could you provide it here or somewhere else, e.g. pastebin?
This warning should not be necessary in this case, but remember not to post code containing sensitive information (such as credentials).
Best,
Oliver
Referred
Thu, 03/01/2018 - 17:17
Permalink
Hi Oliver, Thanks for the
Hi Oliver,
Thanks for the rpely. I added this: https://pastebin.com/ARMJWDBa in a wordpress plugin called: My custom functions. I'm a huge noob when it comes to php.
otacke
Thu, 03/01/2018 - 20:38
Permalink
Hi!We're all noobs with
Hi!
We're all noobs with something, and I'm not good with PHP either. No need to worry.
It doesn't work in your case, because you were following a guide to adding editor buttons to a field that already has the WYSIWYG editor. The description of the personalities. Hasn't. I created a script for you that will give you the WYSIWYG editor for this particular field, but I do not think that it will give you the ability to add more than plain text to the description without changing some code in the personality quiz.
Best,
Oliver
Referred
Fri, 03/02/2018 - 09:06
Permalink
Thanks it did add the WYSIWYG
Thanks it did add the WYSIWYG editor! :-)
How would it be possible to edit the code in the personality quiz? To add more the ability to add options to the field.
otacke
Fri, 03/02/2018 - 09:24
Permalink
Hi!A good start would be to
Hi!
A good start would be to have a look at the developer documentation. You will have to edit the file called "personalityQuiz.js", and depending on your scenario and setup, there will be different ways that should be covered in the documentation.
If you completed that, you could also change the file semantics.json directly (so you will not need the PHP hook script) and create a pull request for your changes at https://github.com/LumeniaAS/h5p-personality-quiz. This way, your changes could become "official" for everyone.
Best,
Oliver
Referred
Thu, 03/08/2018 - 15:02
Permalink
Hi Oliver, I've been trying
Hi Oliver,
I've been trying but i can't get it to work. Would you maybe be interested in doing it for me if i would pay you? :-)
Yannick
otacke
Sat, 03/10/2018 - 14:35
Permalink
Hi Yannick!I was wrong. I
Hi Yannick!
I was wrong. I learn something new about H5P every day. You just need to also explicitly allow the HTML tags that you need. The following script as part of the wordpress plugin should do the trick and allow you to also add links to the personality description. No need to change the code of the content type itself.
Referred
Tue, 03/20/2018 - 14:19
Permalink
Oh sorry! I missed your reply
Oh sorry! I missed your reply. Thanks so much.
I got it working and i also begin to understand it. :-)
otacke
Tue, 03/20/2018 - 15:05
Permalink
Great! Then be both learned
Great! Then be both learned something new :-)
otacke
Thu, 03/08/2018 - 21:36
Permalink
It's probably a few lines of
It's probably a few lines of code -- not worth more than a cup of coffee ;-) The first one's on the house. Let me have a look at it this weekend.