Last modified: 2011-03-13 18:04:51 UTC
Hi. I'm sorry if I'm duplicating another bug, but I only found one other report and that was for 1.5.x. I'm running 1.4.9 and trying to allow people to create pages easily by having a link on search pages. I go to modify Nogomatch and I have tried a few different syntaxes. I initially tried the one from Wikipedia, and that produced the following when I search on a page: No page with that title exists. You can, however '''[[/wiki/index.php?title=Sdfsdfsadfsf&action=edit|create an article with this title]].''' That's not the code, it actually shows that on the search results page when I search for something like "sdfdsaf". However, when I preview Nogomatch while editing, it looks like a normal link and how it should be. I also tried the following code for Nogomatch, and it didn't work either: You can however '''[{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} create an article with this title.]''' Using that code showed similar to the above but with the full URL as well.
In 1.4, try HTML.
Well this was the code I tried initially, just like Wikipedia has: You can however '''[[<nowiki>$1</nowiki>|create an article with this title]].''' That didn't work. What do you mean by HTML? Thanks.
Wikipedia is not running 1.4, it's running a different version which behaves differently. That's why I told you to do something different for your version. HTML is the markup language used for formatting web pages. You can search for more information on HTML in a search engine such as Google.
Right I know what HTML is, but how does HTML integrate with MediaWiki? In other words, what would the target for the a href be to say "create (or edit) the title of the page that was searched for" to allow someone to create a new page?
> In other words, what would the target for the a href be to say "create (or edit) > the title of the page that was searched for" to allow someone to create a new page? If you think about it, you've already answered this yourself: > You can however > '''[{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} create an > article with this title.]''' > > Using that code showed similar to the above but with the full URL as well. So that's where you get the URL from, and the relevance of HTML is that that's what the message is treated as - raw HTML inserted at the appropriate point in the page. [Note also that the $1 is magically substituted with something relevant - it should be easy to discover what by experiment - when the message is used.]
Well, "<a href="{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}}">create an article with this title</a>" doesn't work so I'm not sure what you mean by using HTML. Trying that above code outputs the following as text on the search page: <a href="http://www.mydomain.net/wiki/index.php?title=MediaWiki:Nogomatch&action=edit">create an article with this title</a>. I tried the $1 thing before, and it just shows the text of the link/code instead of linking to it properly. There must be some sort of bug in the software for this not to properly work. I don't know what to say, this can't be entirely an error on my part.
How about: <a href="$1" class="new">create an article with this title</a>....
(In reply to comment #7) > How about: > > <a href="$1" class="new">create an article with this title</a>.... Nope. That just displays that <a href etc...> as text over again like so: You can, however <a href="$1" class="new">create an article with this title.</a>
Works as wiki text in 1.5 upwards. 1.4 is now obsolete.