Extension talk:LinkTarget/Flow

About this board

Not only interwiki links open in a new tab

3
Summary by Elcapitan68

The extension modifies target attribute value in descendants of elements of the class specified in $wgLinkTargetParentClasses.

Rob Kam (talkcontribs)

I'd like to have interwiki links open in a new tab but now even wikilinks are opening in a new tab?


In LocalSettings.php (for a wiki farm):

// LinkTarget

'wgLinkTargetParentClasses' => [

'default' => [],

'simpleelectronicswiki' => ['_blank' => [ 'extiw' ]]

]

Rob Kam (talkcontribs)

Adding this instead, to MediaWiki:Common.js seems to be a solution.


// Add target="_blank" to links with class "extiw" or "external text"

$(document).ready(function() {

$("a.extiw").attr("target", "_blank");

});

Elcapitan68 (talkcontribs)

@Rob Kam Thank you for your message. JS solution works fine, as it is applied to the correct element. Leaving aside the syntax of the variable, when you use LinkTarget, you are expected to specify parent element class rather than link class.

Call to undefined function wfProfileIn() after 1.35.2 upgrade

6
Summary by S0ring

Upgrade LinkTarget from v.0.1 to v.0.2

S0ring (talkcontribs)

The following error ocurrs after upgrade MW 1.15.1 to 1.15.2 (LinkTarget v0.2.0), is there any way to fix it?


Error from line 44 of /var/www/html/extensions/LinkTarget/LinkTarget.php: Call to undefined function wfProfileIn()

Backtrace:

#0 /var/www/html/includes/HookContainer/HookContainer.php(321): {closure}(OutputPage, ParserOutput)

#1 /var/www/html/includes/HookContainer/HookContainer.php(132): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)

#2 /var/www/html/includes/HookContainer/HookRunner.php(2762): MediaWiki\HookContainer\HookContainer->run(string, array, array)

#3 /var/www/html/includes/OutputPage.php(1968): MediaWiki\HookContainer\HookRunner->onOutputPageParserOutput(OutputPage, ParserOutput)

#4 /var/www/html/includes/OutputPage.php(2016): OutputPage->addParserOutputMetadata(ParserOutput)

#5 /var/www/html/includes/page/Article.php(843): OutputPage->addParserOutput(ParserOutput, array)

#6 /var/www/html/includes/actions/ViewAction.php(74): Article->view()

#7 /var/www/html/includes/MediaWiki.php(527): ViewAction->show()

#8 /var/www/html/includes/MediaWiki.php(313): MediaWiki->performAction(Article, Title)

#9 /var/www/html/includes/MediaWiki.php(940): MediaWiki->performRequest()

#10 /var/www/html/includes/MediaWiki.php(543): MediaWiki->main()

#11 /var/www/html/index.php(53): MediaWiki->run()

#12 /var/www/html/index.php(46): wfIndexMain()

#13 {main}

Tosfos (talkcontribs)

Do you mean 1.35.2? 1.15 isn't supported any more.

S0ring (talkcontribs)

yes, sorry, the error ocurrs after upgrade MW 1.35.1 to 1.35.2

X-Savitar (talkcontribs)

From what I see, the file LinkTarget.php doesn't exist in the latest (v0.2) repo. Maybe upgrade LinkTarget extension itself?

What I see in LinkTarget repo is the file LinkTargetHooks.php which doesn't call any function wfProfileIn().

Can you upgrade LinkTarget and let us know @S0ring?

S0ring (talkcontribs)

Yes, no error occurs in MW 1.35.2 with LinkTarget 0.2

Thank you!

X-Savitar (talkcontribs)

@S0ring, good. I'm glad the issue has been resolved now.

Can we resolve this topic @S0ring? Let me know and I will help you do it. :)

documentation insufficient

2
Summary by X-Savitar

no response.

80.153.122.235 (talkcontribs)

Please Make better examples for beginners! What do you mean with Classes and which Classes are aviable? "foo bar" doesnt help me to understand your Plugin! What you mean as Classes?

Can i set default target _new but not for "tel:" Links? and how should i define that? Explaint it better!

X-Savitar (talkcontribs)

Can you let us know if the documentation still confuses you? Thanks!

[edit ] shows up on rendered wiki page

2
Summary by X-Savitar

no response.

Dreamsanatomy (talkcontribs)

I installed the LinkTarget plugin - but after I installed, section editing (i.e. the [edit] mark) started to show up on rendered wiki page.


Is anyone else having similar issue? The MediaWiki version we're using is 1.31.1

X-Savitar (talkcontribs)

Thank for reporting this.

Is this issue still happening today @Dreamsanatomy?

Documentation incorrect?

1
Summary by X-Savitar

Documentation has been updated over time. Thank you!

Kghbln (talkcontribs)

To get external targets for internal links working I had to set:

$wgLinkTargetParentClasses = [
	'_blank' => [
		''
		]
	];

$wgLinkTargetDefault = '_blanc'; was not working for me without specifying this.

There are no older topics
Return to "LinkTarget/Flow" page.