Custom Certificate - New window or tab?

Custom Certificate - New window or tab?

by Marcy Holton -
Number of replies: 5

Maybe I'm missing something, but I am unable to find any setting that will allow the custom cert to be viewed in a new window or tab. Is this not a feature, or does it have to be customized in the code?

Average of ratings: -
In reply to Marcy Holton

Re: Custom Certificate - New window or tab?

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
https://github.com/mdjnelson/moodle-mod_customcert/issues/405 will address this. Will go into the next release. smile
In reply to Mark Nelson

Re: Custom Certificate - New window or tab?

by Robert Wagenhoffer -
Hi Mark,

Just upgraded to Custom certificate, mod_customcert, 3.11.1, 2021051701 and still don't see the option to have the certificate open in a new window. Was this left out for some reason or am I doing missing something?

Thanks for working on this code, it puts the finishing touches on learning...
In reply to Robert Wagenhoffer

Re: Custom Certificate - New window or tab?

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Sorry for the false hope everyone but it doesn't seem the library I am using that generates the PDF supports this functionality. See https://github.com/moodle/moodle/blob/master/lib/pdflib.php#L183 for the list of options that are made available. If I was to add this option I would need to create a hack, so I have created https://github.com/mdjnelson/moodle-mod_customcert/issues/429 to deal with just opening in a new tab. I won't get time to work on it until a few weeks from now.
In reply to Marcy Holton

Re: Custom Certificate - New window or tab?

by Ravi Patel -

So I just ran into this, with the "View certificate" Button and it was getting frustrating for our end users.  I ended up editing the code and I added this line to make it happen: 

$downloadbutton = '<br><a href="/mod/customcert/view.php?id='.$cm->id.'&downloadown=1" class="btn btn-primary" target="_blank">View certificate</a>';

Instead of using the render function, just built the HTML and added it in there for the time being.


Thanks.