moodle-an-hochschulen / moodle-theme_boost_campus

Moodle 3.x Boost child theme which is intended to meet the needs of university campuses and adds several features and improvements ––– for Moodle 4.x please use our Theme Boost Union
GNU General Public License v3.0
38 stars 25 forks source link

Open "Moodle Docs for this page" links with target="_blank" #68

Closed lucaboesch closed 1 year ago

lucaboesch commented 4 years ago

I propose this as a feature request I could help to contribute.

In our theme we modify the Moodle Docs links in the footer to be opened in a new window so that teachers can open the documentation whilst having their content left open simultaneously. I know you can argue that this can also be accomplished with option-click. On the other hand, of course, one can copy the link and paste it into the address bar if they really hate a new tab to be opened.

open MoodleDocs links in new tab

That could be a configurable setting „Moodle Docs link target“ with default „same window“ but also „new tab“ as option to choose.

Count me in as feature owner for this, if that is wanted.

abias commented 3 years ago

Hey @lucaboesch ,

I just stumbled upon this issue within another context.

There is the Moodle core setting doctonewwindow which can be set on /admin/settings.php?section=documentation. Isn't this already what you are asking for here?

Cheers, Alex

johnhpercival commented 2 years ago

Hi Alex, I think you're mostly correct about that setting. However it opens the Help and Documentation in a new popup window. In this day and age I would expect it to open in a new tab, which seems to be what the OP was asking.

The key control is here: https://github.com/moodle/moodle/blob/1a9bee69e60f687bcaf4db0569665f4186c515a4/lib/javascript-static.js#L1235 Changing that "popup" to "_blank" and then removing lines 1239-1254 the will make it open in a new window rather than a popup.

Alternatively, the following Javascript addition will do it: $('a.helplinkpopup').addClass("helplinkpopup2"); $('a.helplinkpopup').removeClass("helplinkpopup"); $('a.helplinkpopup2').attr('target', '_blank');

Hopefully this might be helpful to others who don't like the popup window.

abias commented 1 year ago

As we have documented on https://moodle.org/plugins/theme_boost_campus, Boost Campus will not be continued after Moodle 3.x anymore as we will focus on the successor Boost Union which is published on https://moodle.org/plugins/theme_boost_union. For the time being, as long as Moodle 3.x still receives security support, we will only fix critical bugs in Boost Campus if one arises. And, of course, we try to port over all relevant features of Boost Campus and open proposals for Boost Campus to Boost Union.

I had a look at Moodle 4.x and saw that there, as soon as the Moodle core setting doctonewwindow is enabled, the docs open in a new tab now (and not in a popup anymore).

Against this background, I will close this issue now as it is solved in Moodle 4.x and not an issue for Boost Campus anymore.