Probably showing my 'lack of knowledge ', but there must already be a function that is called when a user clicks on a link and the wiki tries to match the link to a current page and fails, as it then autoloads the editor so the user can create a page, it would be in this step that you could offer a choice.
Well, sortof. When you click a red link, it takes you to the edit page of the chosen article. At this point, the decision to show you the edit form (as opposed to the "this page is empty" message) has already been made. If you do a view-source of the link URL, you'll see that "action=edit" is already in there.
You _can_ hook into MediaWiki at the "show edit page" event and do some cool things with it, but there's no good way to know the article from which the user came - which would be a prerequisite for modifying said article's links. Technically you could use the browser's provided "referrer", but this is unreliable (proxies) and easily spoofed or disabled.
All of that aside - it's still a hard problem because of the nondeterministic nature of wiki rendering and the complications that arise from template transclusion. Even if you know the referrer (as in an Edit Preview), the process of determining where in the wikitext a particular link was generated is daunting.
I'm not trying to say that you're idea is a bad one - or flawed in some way. It sounds like useful functionality to have (in some form), it's just that MediaWiki, in its current form, is not amiable to the development of such an extension.
-- Jim
On 3/7/07, John Moorhouse john.moorhouse@3jays.me.uk wrote:
Probably showing my 'lack of knowledge ', but there must already be a function that is called when a user clicks on a link and the wiki tries to match the link to a current page and fails, as it then autoloads the editor so the user can create a page, it would be in this step that you could offer a choice.
Interestingly my idea of starting with the [[pretty text]] and having a way of choosing the page after the user has saved the page would fail if the pretty text contains any wiki markup [[some pretty '''bold''' text ]] doesn't get rendered as a link, so this would only work if your editors came back to add effects afterwards.
I have noticed that in some situations if you click on a link in the took box or side navigation in a new wiki that has not yet been created you get offered
'There is currently no text in this page, you can search for this page title http://jma-databases.co.uk/index.php/Special:Search/JMA_:Site_support in other pages or edit this page <http://jma-databases.co.uk/index.php?title=JMA_:Site_support&action=edit
.'
I was wondering if what ever is being used to trigger this response could be adapted.
Ta
John
Jim Wilson wrote:
This one sounds (to me) to be a little tougher than the first semi-auto links.
The problem is that when a user "clicks a link", he's clicking the
actual
rendered link, which may not be obvious to detect in the wikitext.
For example, the link could be in a Template instead of the actual
page. Or
worse, it could be a generated link using magic words. For example: [[{{PAGENAME}}/Subpage|subpage pretty text]].
Another problem is links which contain their own markup. For example,
the
following is legal wiki syntax: [[Main Page| some pretty '''bold'''
text]].
This makes parsing the wikitext for the instance of the clicked link harder. Especially when you consider that alternate syntaxes can
produce
the same rendered html. This is the same as above: [[Main Page| some
pretty
<b>bold</b> text]].
Such an extension would need to be able to make these (and many other) distinctions.
I think your idea is interesting - but it's one of those problems that's
a
lot more intricate and difficult to implement than to state.
-- Jim R. Wilson (jimbojw)
On 3/7/07, John Moorhouse john.moorhouse@powys.gov.uk wrote:
In a similar vein to my query about semi-automatic linking I was wondering if any one knows of anything that might do the following.
As an editor I create a some wiki text that includes a link such as [[the link page|This is the pretty text]].
What I'm wonder if it would be possible to to is for the editor to just type [[This is the pretty text]] and save the page.
The page would display the link in red as an unknown link, and what would seem to be good would to offer the editor when they click on the link a choice of
- Linking to a current page
- Creating a new page
If the editor chooses 1 they would then be taken to a search page where they could then search for and find the page they want to link to,
which
would then re-write the link for them as [[the link page|This is the pretty text]]
I can't find anything out there but was just wondered ...
Thanks
John
Cyngor Sir Powys County Council www.powys.gov.uk
Mae'r e bost hwn ac unrhyw atodiad iddo yn gyfrinachol ac fe'i bwriedir ar gyfer y sawl a enwir arno yn unig. Gall gynnwys gwybodaeth freintiedig. Os yw wedi eich cyrraedd trwy gamgymeriad ni ellwch ei gopio, ei ddosbarthu na'i ddangos i unrhyw un arall a dylech gysylltu gyda Cyngor Sir Powys ar unwaith.
Mae unrhyw gynnwys nad yw'n ymwneud gyda busnes swyddogol Cyngor Sir Powys yn bersonol i'r awdur ac nid yw'n awdurdodedig gan y Cyngor.
This e mail and any attachments are confidential and intended for the named recipient only. The content may contain privileged information. If it has reached you by mistake, you should not copy, distribute or show the content to anyone but should contact Powys County Council at once.
Any content that is not pertinent to Powys County Council business is personal to the author, and is not necessarily the view of the Council.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l