Topic on Extension talk:ContactPage

Can't get footer contact link to work. Any idea?

6
Summary by Kghbln

Do not modify the code and provide the translations via the system messages specified. See docu.

Fredrilj (talkcontribs)

The footer link is closed in brackets and look like this: "⧼Kontakt⧽"

https://mydomain.com/wiki/⧼Spesial:Kontakt⧽

Because of this the link to the special contact page will not work. Any idea how to fix this?

This is my code in LocalSettings.php (input is translated to my language):

$wgHooks['SkinTemplateOutputPageBeforeExec'][] = function( $sk, &$tpl ) {
	$contactLink = Html::element( 'a', array( 'href' => $sk->msg( 'Spesial:Kontakt' )->escaped() ),
		$sk->msg( 'Kontakt' )->text() );
	$tpl->set( 'contact', $contactLink );
	$tpl->data['footerlinks']['places'][] = 'contact';
	return true;
};

Fredrilj (talk) 20:04, 1 April 2017 (UTC)

Kghbln (talkcontribs)

Do not do this. Take the code as is and add the translations via the system messages specified.

RadioSaigon (talkcontribs)

I have precisely the same issue on my recent install of Contact Form... the brackets as above enclose both the footer link and the URL. When clicked, MediaWiki tries to create the page of the full URL enclosed by the brackets.

I think the problem may be that I have not yet defined the:

  1. ... the URL of "Special:Contact" to system message MediaWiki:Contactpage-url and
  2. ... the label for "Special:Contact" to system message MediaWiki:Contactpage-label.

parameters... I don't know how or where. Would be very grateful for some direction.

RadioSaigon (talkcontribs)

Well, it's taken hours... but I've managed to figure out what was necessary, after several false starts. I hope this helps someone else:

DO NOT modify the code for your LocalSettings.php AT ALL. It goes in EXACTLY as displayed.

then...

Installation instructions:

  1. ... the URL of "Special:Contact" to system message MediaWiki:Contactpage-url and
  2. ... the label for "Special:Contact" to system message MediaWiki:Contactpage-label.

require you to go to: http://www.yourdomain.com/MediaWiki:Contactpage-url, create the page, which will contain only the URL to your Special:Contact page

Similarly, create the page http://www.yourdomain.com/MediaWiki:Contactpage-label on your wiki, containing only the text you desire for your footer link.

Job done. Bob's your Auntie.

Kghbln (talkcontribs)
Kghbln (talkcontribs)

Ah, I did not see your post before. Yes, great, good that it worked out and elaborating for other what to do in case of doubt.