[Mediawiki-l] Internal link with query string?

Daniel Barrett danb at VistaPrint.com
Mon May 7 21:01:11 UTC 2007


>Well, you probably want to avoid modifying the core code if at all
possible
>- it will make future upgrades much more difficult if you do.

I agree, though we encapsulate our changes pretty well using Subversion
"vendor branches."

>I really don't understand enough about the problem to help
>- it seems you're trying to mix wikitext, wfMsg text and php code
>- so I'm confused as to what you're trying to do.  What's the end goal?

Sure: here's the background.

At my company, we want our wiki pages to contain certain standard
information: an introductory overview, a "Foo" heading, a "Bar"
subheading, etc.  In fact, we have numerous "standard" article types:
New Project page, Requirements Document page, Technical Spec page,
Laundry List page, etc.  I want to define these types, and when the user
edits a brand new article of these types, we want some standard, initial
wikitext automatically inserted into the editor.

I have evaluated several extensions that do similar things, but they are
all limited in various ways.  (I can go into detail if desired.)

So I wrote a Special page that presents the user with a dropdown list of
these "preset" article types:   Select one, enter an article name, and
you're dropped into the editor with the correct starting wikitext ready
to go.  Want a requirements document? Just select Requirements Document,
enter an article name, and click Submit.  You're in the editor.

This works fine as a Special page.  But now I want to modify
Special:Search to link to my Special page. Instead of displaying:

  '''There is no page titled "$1".''' You can [[:$1|create this page]].

I want it to offer the user a choice between a blank page or a standard
article type:

  '''There is no page titled "$1".''' You can create this page
[[:$1|blank]] or using
[[{{fullurl:Special:MyPresetPageTypes|arg={{urlencode:$1}}}} a standard
article type]]

In other words, within wikitext, I want to reference the search term
that was passed to Special:Search, so I can pass it in turn to my own
special page, Special:MyPresetPageTypes.

The underlying problem is how to pass this value from within wikitext to
Special:MyPresetPageTypes. Perhaps there's a way to do this without a
query parameter.

Thanks for any advice.

DanB

---------------------
Confidentiality note
The information in this email and any attachment may contain confidential and proprietary information of VistaPrint and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, please notify the sender immediately and delete this email and any attachment from your system.
---------------------



More information about the MediaWiki-l mailing list