Custom menu items - open in new window

Re: Custom menu items - open in new window

by Joost Elshoff -
Number of replies: 7
Picture of Particularly helpful Moodlers Picture of Testers

Hi Mary,

I doubt that would work in the direction of a solution. The thing is, the target bit of the HTML here is being seen as part of the url:

The thing I'm aiming for is:

Support|https://www.the.url/course/index.php?categoryid=119" target="_blank

But it becomes:

https://www.openedu.nl/moodle/course/index.php?categoryid=119%22%20target%3D%22_blank

I don't know whether reversed encoding makes any sense then, but sure would like to have this URL open in a new tab or window.

In reply to Joost Elshoff

Re: Custom menu items - open in new window

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

The thing is that firstly the problem with the encoding is caused by your server.

Adding a link here in this forum does not add the code.

However, the target=_blank has not worked for years. which is probably a browser problem.

Even using Right click and select open in new window,  has no effect either so...I think this is bug that will never get fixed.

In reply to Joost Elshoff

Re: Custom menu items - open in new window

by Jane Stradins -

Hey Joost, I've just tried your advice above, adding:

" target="_blank
and it worked for me!

Thank you

In reply to Jane Stradins

Re: Custom menu items - open in new window

by Meindert Jorna -

Thanks, this works for me also:

" target="_blank
Average of ratings: Useful (1)
In reply to Joost Elshoff

Re: Custom menu items - open in new window

by Michael Zehr -

I have the same problem.  I tried every variation I could think of with spaces and quotes and back-quotes but it seems once the moodle parser detects parameters being passed it consumes everything until the vertical bar, escaping as it goes and putting it into the URL 

I suppose one could make a local html with no parameters that automatically redirects to the correct page with parameters?  I don't think I'm going to do this, but I'm going to follow this in case someone else can fix it.

In reply to Michael Zehr

Re: Custom menu items - open in new window

by ovsiknela . -

Hi all, for me worked this:

FORUM|/mod/forum/view.php&#63id=46"target="_blank

I replaced the question mark (?) in url with ascii code (&#63) for this symbol.

Nothing else helped..


Average of ratings: Useful (2)
In reply to ovsiknela .

Re: Custom menu items - open in new window

by Sarah Ashley -
Thank you so much!
This is the solution that worked for me as well, replacing the ? with the ascii ?
Awesome.
In reply to ovsiknela .

Re: Custom menu items - open in new window

by William Pelissari -

Thank you very much Great solution. I was trying to switch from = to ASC, but after ? no longer recognized. Hadn't thought of changing the ?. 

Great solution. 

Thank you very much! 

Helped me a lot. 

Hugs