Whilst small files can be uploaded to forum posts, if you have a custom theme or module to contribute please add it on the "Add-ons" page.
  • Page:
  • 1
  • 2

TOPIC:

Vytux Menu2 - open link in new tab? 3 years 11 months ago #1

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
Forgive me if this is answered elsewhere. I did a couple of searches and couldn't find anything that answered this.

I have installed Vytux Menu2, change the Menu name, and all is working well with the exception that the menu items that all link to external sites open in the same tab as Webtrees.

My members will mostly be pretty much novice computer users, so I would like any external links in Vytux_Menu2 to open in a new tab, so people can get back to webtrees itself easily, or leave the other page open so they can peruse what's on it. In my experience, it's confusing to novices when they can't figure out how to get back to where they came from.

Yes, I know hitting the backspace key isn't that difficult for those of us who feel comfortable with computers, but it's stressful for those who aren't comfortable yet. Also, I've chosen to have one of the external links be to a Flickr account which already contains a large volume of images of genealogy records relating to the tree we'll be dealing with in Webtrees, rather than put those images under Webtrees, to save server memory and space. So I would like to be able to tell my users that they can open the photos and look at the images at the same time as they are perusing the tree.

I've read through the readme for the Vytux_Menu2 module, and this subject isn't addressed there, that I could find. I'm hoping there's some item in the module.php that can be changed or something added that would allow the menu items to open in a new tab. I looked through it and didn't find anywhere it seemed logical for it to be, but that doesn't mean there isn't such a location, I just didn't find it. Is there a way to do this?

Thank you.
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

Vytux Menu2 - open link in new tab? 3 years 11 months ago #2

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Gold
  • Gold
  • Greetings from Utrecht, Holland
  • Posts: 1986
Hi Susan,

Opening a link in a new tab is done by setting the "target" attribute to "_blank" in the "<a href='http' >" tag:
www.w3schools.com/tags/att_a_target.asp

You could probably hack that hard-coded in this module, otherwise you'd have to contact Vytux whether a config option to open the link in a new tab can be added.
stamboom.BertKoor.nl runs on webtrees v1.7.13

Please Log in or Create an account to join the conversation.

Vytux Menu2 - open link in new tab? 3 years 11 months ago #3

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
Thank you for your response. The Vytux_Manu2 module doesn't work with an html link, I'd already tried that and should have mentioned it.

As for contacting Vytux, I'll do that, but in looking at his/her site this morning, I found the following as a note to a prior version of the menu:

"1.6.1 - 1.6.4 14 November 2014 Updated to support webtrees 1.6.1

webtrees no longer supports '_blank' target so this option has also been removed from this module. For more information of why this is a good thing please refer to css-tricks.com/use-target_blank/ "

That sounds to me like webtrees itself has made the choice for me, whether or not I can have a link open in a new tab instead of the current one.

I'll contact Vytux. Thank you very much!
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

Vytux Menu2 - open link in new tab? 3 years 11 months ago #4

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
P.S I forgot to mention I've found a Chrome browser extension that does what I want on my computer, and will let my users know about that, but that won't help my novice users. Expecting them to be able to install a browser extension would probably make them flee the site.

I'll create a FAQ for them to let them know they can Ctrl+click on the links they want opened in a new tab, also. That works in most browsers.

Interestingly, all of the external links in the Links menu item at the top of this forum, open in a new tab.
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

Last edit: by islander. Reason: Add interesting observation

Vytux Menu2 - open link in new tab? 3 years 11 months ago #5

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
Well, I think I've come up with a solution to my problem. My original thought was to have webtrees be the main application on the site. But since I can't open the other applications from Webtrees, or link to external sites from Webtrees, webtrees won't be the main landing site and main application for my entire site.

Instead, I'll link to webtrees as an external application from one of the other applications, a discussion forum, which will become the main application and landing page for the site. The discussion forum software allows me to add menu items which can be html coded links that include the target=_blank. So I can add a link to webtrees and the images that both open in new tabs.

I think most of the activity will be in the discussion forum, anyway, because we'll be working on projects of working together on determining the next steps necessary to find records, and then finding the records before adding someone to the tree. It will be a "work room" where the kinks of an individual are worked out before they are added to the tree.

I think that will work better for our purposes than the other way around, and it will help the novices feel less intimidated because they'll just need to type about what they know, and not add it to a program they don't yet feel comfortable with.
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #6

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
Problem solved.
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #7

  • ToyGuy
  • ToyGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Live like it's Christmas every day - Santa Stephen
  • Posts: 4925
Islander
Good luck on your forum attempt for coordinating your family's GEDCOM attempts. I became so frustrated with my 400 family members with 6 posts in three years, that obviously, I abandoned that approach. Perhaps you will be more successful.
Santa Stephen the Fabled Santa
Latest webtrees at MyArnolds.com
Hosted by webtreesonline.com , a division of GeneHosts LLC
MacOS 10.6.8, Apache 2.2+, PHP 5.4.16, MySQL 5.5.28

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #8

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
Thank you. I've gathered together a fairly small group of less than a dozen family members who are presently highly motivated to join together to expand one particular surname line we share. We've just connected with one another in different countries, from whence some of our ancestors emigrated to where some of us currently live, and others are related to those who remained behind. So, while in the long term the discussion forum might not live beyond 6 months, I'm pretty sure it will last long enough for us to fill in the holes we each have in our genealogy, and perhaps find some ancestors further back.

So neither this site nor the discussion forum are expected to be very active for very long, because it's has a finely targeted purpose.

I'm sorry to hear that your efforts didn't work out. My early efforts in the early 1990s to get family members involved in genealogy didn't work well, either, but this is a highly motivated group, whereas earlier was before genealogy became something more people were interested in. In this case, I've had people excited that there will be a discussion group, champing at the bit to get it started, because it will be easier than it has been with emails flying back and forth between multiple people about the same things. The discussion forum should make it easier for us to follow each other's research, and will launch, now, in just a couple of days, if not tomorrow. Webtrees/ Vytux menu issues was the holdup for the whole thing, and now that's resolved, off we go!

Thanks for the warning, though, Santa! Can I have a Tesla for Christmas this year? LOL
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

Last edit: by islander. Reason: Remove double signature
Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #9

  • ToyGuy
  • ToyGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Live like it's Christmas every day - Santa Stephen
  • Posts: 4925

My elves make toys, so a 1/64th scale may be in your future. Don't be disappointed.
Santa Stephen the Fabled Santa
Latest webtrees at MyArnolds.com
Hosted by webtreesonline.com , a division of GeneHosts LLC
MacOS 10.6.8, Apache 2.2+, PHP 5.4.16, MySQL 5.5.28
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by ToyGuy.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #10

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
How could I be disappointed by something made by Elves! Looking forward to it!
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #11

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13364
you could do this witj one line of javascript.

pnclick, if a.href does not start with your domain then set tsrget=_blank
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #12

  • thomas52
  • thomas52's Avatar
  • Offline
  • Frequent
  • Frequent
  • Western North Carolina
  • Posts: 893
Susan: You may not need to make an either/or choice. My home page - www.adkins.ws/ - has several links to Facebook & Google which effectively link back to my website.
Also note the somewhat mislabeled 'Menu' option on my main menu.
You may be able to link your website to your discussion page, and link your discussion page back to your webtrees.
"Failure is an amazing teacher." (L'échec est un professeur extraordinaire.)

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #13

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
Thank you for your reply.

Where in webtrees would I place that javascript?
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

Last edit: by islander. Reason: Remove second signature

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #14

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
Thank you for your reply.

Maybe I'm just being dense this morning, which is a possibility every morning at my age, but I'm not seeing where you link to external sites that open in new tabs? That's my issue.

But you've given me an idea that's so simple, I can't believe I didn't think of it before, which is to create a landing page with external links to all three applications - the discussion forum, webtrees and the image gallery. I was so intent on getting the links to work IN the application, I didn't stand back and look at what others ways I might accomplish the same thing.

Right now I don't think I need that, though, because I've solved the problem by having the discussion forum be the landing page and linking to the others within it. My site is private, also, so I probably don't really want that, either, as I'd rather have no public-facing links for this site. I have a different site where I've published quite a bit of genealogy information, so it's not like I'm trying to hide anything, I'm just trying to create a comfortable space for skittish people to share information.

Your site looks very nice! You've done a wonderful job with it!
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #15

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13364

islander wrote: Thank you for your reply.

Where in webtrees would I place that javascript?


if you have a custom theme use that
if not use custom js module
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #16

  • islander
  • islander's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 47
Thank you for your reply.

I don't have a custom theme. I had wanted to set this all up with as little fuss and bother as possible, and I'm not implying webtrees is a lot of fuss and bother, I'm just saying I wanted to have to do as little as possible to get it up and running. The themes that are available are fine for my purposes. This is a small application of webtrees for a small audience and with a fairly small tree. It's also not something the public will see, so doesn't have to be fancy.

I think I'll just use the method I chose earlier, which is to have the discussion forum be the landing page. I've already got the links on that up and working as desired. But I'll take your suggestion and add it to a todo list, to add menu options to webtrees later, so people can start there, if they prefer.

Thanks again. I very much appreciate the help.
Susan

Webtrees 1.7.7, PHP 5.6.23

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #17

Hi Greg,
I read this discussion and would like to use it on my site.
I have enabled custom.js but am not sure about the exact syntax of the javascript.
Could you please provide me with that?
My domain is : roeljongman.nl
Roel - This email address is being protected from spambots. You need JavaScript enabled to view it. - www.roeljongman.nl
Windows10 - 64, Palemoon browser - webtrees 1.7.16 - Apache 2.2 - PHP 7.2.19 - MySQL 5.5.43 Community

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 3 years 11 months ago #18

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13364
jQuery("body").on("click", "a[href^=http]", function() { jQuery(this).attr("target", "_blank"); });

In English:

If somebody clicks on a link, and the link begins "http", then force it to open in a new link.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 7 months 1 week ago #19

Greg,

This answer 3 years ago has helped me a lot.
But can you adjust it so that it will working for both http and https-links?
I don't have the knowledge to do it.
Roel - This email address is being protected from spambots. You need JavaScript enabled to view it. - www.roeljongman.nl
Windows10 - 64, Palemoon browser - webtrees 1.7.16 - Apache 2.2 - PHP 7.2.19 - MySQL 5.5.43 Community

Please Log in or Create an account to join the conversation.

[SOLVED] Vytux Menu2 - open link in new tab? 7 months 1 week ago #20

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13364
Maybe something like this:
<script>
$("a").each(function () { if ($(this).hostname !== location.hostname) a.target="_blank"; });
</script>
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum