Topic on Project:Support desk

Jump to navigation Jump to search

Making interwiki links the default for a page or section

7
Evolution and evolvability (talkcontribs)

Hello, In the WikiJournal sections on Wikiversity, most links are intended to point to Wikipedia (example) so have to repeatedly use the [[w:link|link]] interwikilink format rather than just [[link]]. Is there a way to make links in certain pages, or page sections point to wikipedia by default? Similarly, the list of suggested links from citoid is just within wikivversity. Is it posible to populate this list with wikipedia hits instead when editing specified pages? Thanks in advance for any ideas!

AhmadF.Cheema (talkcontribs)

Since no one answered, I think the only way to do this would be through a template, or for shorter use, the equivalent [[w:link|]] will also work.

Evolution and evolvability (talkcontribs)

Hmm, I see what you mean but I think it ends up with a similar problem. The two situations that I'm trying to make easy are:

  1. Inexperienced editor uses VisualEditor to insert link to Wikipedia in WikiJournal article
  2. Section of wikimarkup copied directly from Wikipedia to WikiJournal, retaining links point to Wikipedia
101.160.14.201 (talkcontribs)

You could make redirects to all those wikipedia pages. Though it wouldn't be clear that you're going to wikipedia until after you've clicked the link.

Evolution and evolvability (talkcontribs)

Hmm, interesting idea. I've not found how to make an inter-wiki redirect.

However, there are often >100 such links per article (example), so making that many redirects would be quite a lot of work.

Are there any LUA solutions?

Evolution and evolvability (talkcontribs)

I've managed to make a template that uses the string replace module to convert wikilinks to interwikilinks here:

v:Template:Default_interwiki

However it's not compatible with VisualEditor (everything appears within the template)

Example here

Is there any way to apply such a template by default to a page so that the template doesn't have to be explicitly called, or to get VisualEditor to 'ignore' a template? Possibly there's some solution based on <templatestyles>?

Also ping user:TheDJ in case this is in your knowledge sphere.

Thanks again for all the ideas!

Evolution and evolvability (talkcontribs)

Aha - another step forward - recursive transclusion of {{#String:replace}} means that a single substitution of the v:Template:Default_interwiki template will change all links in a page.

Reply to "Making interwiki links the default for a page or section"