URL A Target Window (and B and C)

Need help with the Administration of your Joomla! 4.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Post Reply
GillianBPP
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Wed Oct 01, 2014 10:25 am

URL A Target Window (and B and C)

Post by GillianBPP » Sun Nov 14, 2021 5:53 pm

Can someone please explain what these three options, to be found in Global Configuration > Articles > Editing Layout tab (both J3 & J4), are used for and why there are three of them?

Image

Thank you.
You do not have the required permissions to view the files attached to this post.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 40471
Joined: Sat Apr 05, 2008 9:58 pm

Re: URL A Target Window (and B and C)

Post by Webdongle » Sun Nov 14, 2021 6:14 pm

They set the default way each link opens and the settings can be changed in the Article edit screen 'images and links' tab.

When you are in the Article edit screen 'images and links' tab you define the links and their text. The hyperlinks will then display on the Article page in a pre formatted way.

Never used it until I tested what it did so I could answer your question. (which by now you will have been clever enough to test for yourself? :D )

Addendum
The help link tells you the answer as well https://help.joomla.org/proxy?keyref=He ... _and_Links :laugh:
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

GillianBPP
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Wed Oct 01, 2014 10:25 am

Re: URL A Target Window (and B and C)

Post by GillianBPP » Sun Nov 14, 2021 6:26 pm

:-[ Ok. I tested it.

But why would anyone want to put three links at the top of an article?

I was hoping that they might be used so define internal URLs as type A, external URLs as type B, so that I could always have external URLs open in a new window - or not, depending on what the client wants.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 40471
Joined: Sat Apr 05, 2008 9:58 pm

Re: URL A Target Window (and B and C)

Post by Webdongle » Sun Nov 14, 2021 9:28 pm

But you have that. Each url can be either internal or external. The 'Target window can be New, Parent, Popup or Modal.
The point is that you can use use overrides (I think) to change their position in the Article. Also you can change the box they are in etc. Which means the person editing the Article does not have to arrange the links themselves.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 27807
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: URL A Target Window (and B and C)

Post by imanickam » Mon Nov 15, 2021 4:04 am

GillianBPP wrote:
Sun Nov 14, 2021 5:53 pm
Can someone please explain what these three options, to be found in Global Configuration > Articles > Editing Layout tab (both J3 & J4), are used for
You could use them for any purpose. For example, if you want to show an external link that is related to the article you could use them. I use it in one of my sites to show the link to Google Photos albums that are related to the article.


GillianBPP wrote:
Sun Nov 14, 2021 6:26 pm
But why would anyone want to put three links at the top of an article?
That is the default position. You could change it in the screen "Articles: Options" (to be set Globally) or in the screen "Menus: Edit Item" (to be set at the Menu Item level).

In the screen "Articles: Options" in the tab "Articles", you would notice the option "Positioning of the Links" that controls where thee links are to be displayed (Above, Below, or Hide).

Similarly, in the screen "Menus: Edit Item" in the tab "Options" (for the menu item of the type Single Article), you would notice the option "Positioning of the Links" that could override the Global option.


Note:
If you are not satisfied with the placement of the links, you could always do the HTML Override technique as mentioned by Webdongle.
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Joomla! Core - Tamil (தமிழ்) Translation Team Coordinator
ex-Joomla! Translations Coordination Team
Eegan - Support the poor and underprivileged

GillianBPP
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Wed Oct 01, 2014 10:25 am

Re: URL A Target Window (and B and C)

Post by GillianBPP » Mon Nov 15, 2021 8:03 pm

Webdongle wrote:
Sun Nov 14, 2021 9:28 pm
But you have that. Each url can be either internal or external. The 'Target window can be New, Parent, Popup or Modal.
The point is that you can use use overrides (I think) to change their position in the Article. Also you can change the box they are in etc. Which means the person editing the Article does not have to arrange the links themselves.
I know I can set each URL manually, what I meant was having internal URLs as 'not set' or self by default and external as 'new window' by default.

User avatar
mandville
Joomla! Master
Joomla! Master
Posts: 15082
Joined: Mon Mar 20, 2006 1:56 am
Location: The Girly Side of Joomla in Sussex

Re: URL A Target Window (and B and C)

Post by mandville » Mon Nov 15, 2021 8:26 pm

GillianBPP wrote:
Mon Nov 15, 2021 8:03 pm
I know I can set each URL manually, what I meant was having internal URLs as 'not set' or self by default and external as 'new window' by default.
so if i understand, you want to create a pull request that changes the default and expected behaviour of nearly every website when you click a link that opens the requested page in the same window, to have every joomla open a link in a new window as default.
HU2HY- Poor questions = Poor answer
Un requested Help PM's will be reported, added to the foe list and possibly just deleted
{VEL Team Leader}{TM Auditor }{ Showcase & Security forums Moderator}

GillianBPP
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Wed Oct 01, 2014 10:25 am

Re: URL A Target Window (and B and C)

Post by GillianBPP » Tue Nov 16, 2021 9:57 am

mandville wrote:
Mon Nov 15, 2021 8:26 pm
so if i understand, you want to create a pull request that changes the default and expected behaviour of nearly every website when you click a link that opens the requested page in the same window, to have every joomla open a link in a new window as default.
No. Not at all. What I would like is to have the OPTION - the choice - to set internal URLs to always open in the same window and the OPTION to have external URLs (i.e. to other websites) to always open in another window. Or not, as the case may be per website.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 40471
Joined: Sat Apr 05, 2008 9:58 pm

Re: URL A Target Window (and B and C)

Post by Webdongle » Tue Nov 16, 2021 3:06 pm

GillianBPP wrote:
Tue Nov 16, 2021 9:57 am
...

No. Not at all. What I would like is to have the OPTION - the choice - to set internal URLs to always open in the same window and the OPTION to have external URLs (i.e. to other websites) to always open in another window. Or not, as the case may be per website.
You do have the option ... it's a dropdown box.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

GillianBPP
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Wed Oct 01, 2014 10:25 am

Re: URL A Target Window (and B and C)

Post by GillianBPP » Tue Nov 16, 2021 6:47 pm

Webdongle wrote:
Tue Nov 16, 2021 3:06 pm
You do have the option ... it's a dropdown box.
The dropdown is for selecting where the URL opens on an individual basis and has to be selected each time a URL is inserted, unless you stick with --Not Set--.

But... if you have a front-end editor who doesn't know about these things they probably wouldn't even notice 'Target'. It's bad enough getting them to write something in the 'Title' field. And if the website policy is to always open external URLs in a new window, it would be useful to have an optional setting somewhere in Global Configuration that - if selected - makes this happen automatically.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 40471
Joined: Sat Apr 05, 2008 9:58 pm

Re: URL A Target Window (and B and C)

Post by Webdongle » Tue Nov 16, 2021 7:37 pm

So that would mean that Joomla (or the super admin) would have to read the mind of the person who was editing. And know what default the editor wanted. If you have editors who don't know how to use the editor then that is your issue not an issue with Joomla settings.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12312
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: URL A Target Window (and B and C)

Post by brian » Tue Nov 16, 2021 10:07 pm

There are many ways that you can run javascript on your site that will force all external links to open in a new tab. For example https://css-tricks.com/snippets/jquery/ ... nal-links/
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

GillianBPP
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Wed Oct 01, 2014 10:25 am

Re: URL A Target Window (and B and C)

Post by GillianBPP » Thu Nov 25, 2021 10:32 am

brian wrote:
Tue Nov 16, 2021 10:07 pm
There are many ways that you can run javascript on your site that will force all external links to open in a new tab. For example https://css-tricks.com/snippets/jquery/ ... nal-links/
Thank you, @Brian.

If I can work out how to convert this to JavaScript from JQuery - as J4x is not using JQuery, then I'll have a go.

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12312
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: URL A Target Window (and B and C)

Post by brian » Thu Nov 25, 2021 10:36 am

try

Code: Select all

document.querySelector('a:not([href^="http://your-website.com"]):not([href^="#"]):not([href^="/"])').classList.add('external');
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

GillianBPP
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 221
Joined: Wed Oct 01, 2014 10:25 am

Re: URL A Target Window (and B and C)

Post by GillianBPP » Thu Nov 25, 2021 11:25 am

brian wrote:
Thu Nov 25, 2021 10:36 am
try

Code: Select all

document.querySelector('a:not([href^="http://your-website.com"]):not([href^="#"]):not([href^="/"])').classList.add('external');
Thanks, but I got "Uncaught TypeError: document.querySelector(...) is null"


Post Reply

Return to “Administration Joomla! 4.x”