Hello,
Does MediaWiki allows to automatically put a certain text in advance on a non-existing page? What I am trying to do is this: when users click on a picture, a (link to a) new page is generated with the name "{{PAGENAME}}-more-detailed-name".
Is it possible to already put automatically some text (e.g. "{{template}}") on this new (non existing) page?
greetings, JAN
Jan Vanoverpelt wrote:
Does MediaWiki allows to automatically put a certain text in advance on a non-existing page? What I am trying to do is this: when users click on a picture, a (link to a) new page is generated with the name "{{PAGENAME}}-more-detailed-name".
Is it possible to already put automatically some text (e.g. "{{template}}") on this new (non existing) page?
http://meta.wikimedia.org/wiki/Help:Inputbox
-- brion vibber (brion @ pobox.com)
Thanks, the preload parameter that can be used by the inputbox does indeed exactly what i need...BUT what i actually want is not creating a page through an inputbox, but through an image: 1) the user clicks on the image 2) the newly created page appears in front of the user with the predefined text in the edit box of this new page.
In order for the user to be able to create a new page by clicking on an image, i use the following template (called "hotspot"):
<div style="position: relative; height: {{{Height}}}; width: {{{Height}}}; overflow: hidden;"> <div style="position: absolute; top: 0; left: 0; font-size: 100px; height: {{{Height}}}; width: {{{Height}}}; overflow: hidden; line-height: 100px; z-index: 3;">[[:{{{Link}}}| ]] </div> <div style="position: absolute; top: 0; left: 0; z-index: 2;"> [[Image:{{{Image}}}|{{{Height}}}|{{{Link}}}]] </div> </div>
So the image is put on the wiki e.g. in this way:
{{hotspot | | Image = image.gif | Link = new-page-to-be-made | Height = 81px }}
What i would like to achieve now is to put a preload-parameter into it (just like is done with the inputbox), so the above becomes:
{{hotspot | | Image = image.gif | Link = new-page-to-be-made | Height = 81px | Preload= the-preloaded-text }}
Does somebody know whether i can achieve this by adapting the "hotspot"-template or is there another way?
Many thanks in advance!
JAN
2006/3/30, Brion Vibber brion@pobox.com:
Jan Vanoverpelt wrote:
Does MediaWiki allows to automatically put a certain text in advance on
a
non-existing page? What I am trying to do is this: when users click on a picture, a (link to a) new page is generated with the name "{{PAGENAME}}-more-detailed-name".
Is it possible to already put automatically some text (e.g.
"{{template}}")
on this new (non existing) page?
http://meta.wikimedia.org/wiki/Help:Inputbox
-- brion vibber (brion @ pobox.com)
Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
On 31/03/06, Jan Vanoverpelt jan.vanoverpelt@gmail.com wrote: [snippety snip]
What i would like to achieve now is to put a preload-parameter into it (just like is done with the inputbox), so the above becomes.
http://en.wikipedia.org/w/index.php?title=This_is_not_a_real_page&action...
You can use {{FULLURL}} (or {{LOCALURL}} etc), the title, and the preload parameter to achieve this.
Rob Church
I added the preload parameter like this:
{{hotspot | | Image = image.gif | Link = new-page-to-be-made | Height = 81px | Preload= the-preloaded-text }} but without any result.
When i put Link= http://en.wikipedia.org/w/index.php?title= new-page-to-be-made&action=edit&preload=the-preloaded-text , then i get a link to a non-existing page named " http://en.wikipedia.org/w/index.php?title=new-page-to-be-made&action=edi... the-preloaded-text" , but without the template being added in the edit-box.
Do you mean i have to adapt my hotspot-template? I don't see how i should do this, because the "Link-parameter" is already added. Do I just have to add a {{{{Preload}}} parameter after each {{{Link}}} parameter in the hotspot-template?
Kind regards and thanks for the help! JAN
2006/3/31, Rob Church robchur@gmail.com:
On 31/03/06, Jan Vanoverpelt jan.vanoverpelt@gmail.com wrote: [snippety snip]
What i would like to achieve now is to put a preload-parameter into it
(just
like is done with the inputbox), so the above becomes.
http://en.wikipedia.org/w/index.php?title=This_is_not_a_real_page&action...
You can use {{FULLURL}} (or {{LOCALURL}} etc), the title, and the preload parameter to achieve this.
Rob Church _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Jan Vanoverpelt wrote:
Do you mean i have to adapt my hotspot-template? I don't see how i should do this, because the "Link-parameter" is already added. Do I just have to add a {{{{Preload}}} parameter after each {{{Link}}} parameter in the hotspot-template?
Try replacing the "[[:{{{Link}}}| ]]" in your template with:
[{{fullurl:{{{Link}}}|preload={{{Preload|}}}&action=edit}} ]
(This might be a good time to repeat my wish for an {{urlencode: ... }} function to be added to MediaWiki.)
2006/4/3, Ilmari Karonen nospam@vyznev.net:
Try replacing the "[[:{{{Link}}}| ]]" in your template with:
[{{fullurl:{{{Link}}}|preload={{{Preload|}}}&action=edit}} ]
Thanks, I tried this but unfortunately without satisfying result: what I get then is a link like "http://en.wikipedia.org/w/index.php?title=Template:FULLURL:new-page-to-be-ma..." without any preload function. The image itself seems also overwritten by some huge symbols "[[T".
Any other ideas?
If you work on MediaWiki 1.5, please replace "{{fullurl:" with "{{SERVER}}{{localurl:".
Jan Vanoverpelt wrote:
2006/4/3, Ilmari Karonen nospam@vyznev.net:
Try replacing the "[[:{{{Link}}}| ]]" in your template with:
[{{fullurl:{{{Link}}}|preload={{{Preload|}}}&action=edit}} ]
Thanks, I tried this but unfortunately without satisfying result: what I get then is a link like "http://en.wikipedia.org/w/index.php?title=Template:FULLURL:new-page-to-be-ma..." without any preload function. The image itself seems also overwritten by some huge symbols "[[T".
Any other ideas? _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Thank you all for the help: it works now!
I have replaced [[:{{{Link}}}| ]] by [{{SERVER}}{{localurl:{{{Link}}}|preload={{{Preload}}}&action=edit}}]
Kind regards, JAN
2006/4/3, Rotem Liss mail@rotemliss.com:
If you work on MediaWiki 1.5, please replace "{{fullurl:" with "{{SERVER}}{{localurl:".
Jan Vanoverpelt wrote:
2006/4/3, Ilmari Karonen nospam@vyznev.net:
Try replacing the "[[:{{{Link}}}| ]]" in your template with:
[{{fullurl:{{{Link}}}|preload={{{Preload|}}}&action=edit}} ]
Thanks, I tried this but unfortunately without satisfying result: what I
get
then is a link like "
http://en.wikipedia.org/w/index.php?title=Template:FULLURL:new-page-to-be-ma... "
without any preload function. The image itself seems also overwritten by some huge symbols "[[T".
Any other ideas? _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
2006/4/4, Jan Vanoverpelt jan.vanoverpelt@gmail.com:
Thank you all for the help: it works now!
...BUT 1 practical problem is still there: Scenario: 1) The user clicks on an image, which refers to a non-existing page. 2) The user is linked to the non-existing page's edit-box in which the preloaded text is written. 3) The user adds some additional text and saves the page. 4) The user leaves the pages, surfs around on the wiki and goes back to the image through which he previously created the new page. This is the point where the practical problem jumps in: the user clicks on the image, BUT he is AGAIN taken directly to the edit-box INSTEAD OF being taken to the actual page (which exists now, so he does not have to be linked directly to the edit-box of the page).
I think this problem is due to the fact that i have created some kind of "hard link" behind the image, so that the user is always forced to go directly to the edit-box with the preloaded text in it. Is there a way to fix this, so that the user (after he/she visited the non-existing page for the first time, added something and saved it) is directly taken to the actual page the second time (like is done in case of "normal" links) ??
Thanks!
JAN
2006/4/4, Jan Vanoverpelt jan.vanoverpelt@gmail.com:
Thank you all for the help: it works now!
I have replaced [[:{{{Link}}}| ]] by [{{SERVER}}{{localurl:{{{Link}}}|preload={{{Preload}}}&action=edit}}]
Kind regards, JAN
2006/4/3, Rotem Liss mail@rotemliss.com:
If you work on MediaWiki 1.5, please replace "{{fullurl:" with "{{SERVER}}{{localurl:".
Jan Vanoverpelt wrote:
2006/4/3, Ilmari Karonen <nospam@vyznev.net >:
Try replacing the "[[:{{{Link}}}| ]]" in your
template
with:
[{{fullurl:{{{Link}}}|preload={{{Preload|}}}&action=edit}} ]
Thanks, I tried this but unfortunately without satisfying result: what
I get
then is a link like "
http://en.wikipedia.org/w/index.php?title=Template:FULLURL:new-page-to-be-ma... "
without any preload function. The image itself seems also overwritten
by
some huge symbols "[[T".
Any other ideas? _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Yes, I think there is: the English Wikipedia has an "exists" template http://en.wikipedia.org/wiki/Template:Exists to check if a particular page has been created yet.
Jan Vanoverpelt wrote:
2006/4/4, Jan Vanoverpelt
Thank you all for the help: it works now!
...BUT 1 practical problem is still there: Scenario:
- The user clicks on an image, which refers to a non-existing page.
- The user is linked to the non-existing page's edit-box in which the
preloaded text is written. 3) The user adds some additional text and saves the page. 4) The user leaves the pages, surfs around on the wiki and goes back
to the
image through which he previously created the new page. This is the
point
where the practical problem jumps in: the user clicks on the image,
BUT he
is AGAIN taken directly to the edit-box INSTEAD OF being taken to the
actual
page (which exists now, so he does not have to be linked directly to the edit-box of the page).
I think this problem is due to the fact that i have created some kind of "hard link" behind the image, so that the user is always forced to go directly to the edit-box with the preloaded text in it. Is there a way to fix this, so that the user (after he/she visited the non-existing
page for
the first time, added something and saved it) is directly taken to the actual page the second time (like is done in case of "normal" links) ??
Thanks!
JAN
I tried to modify the "exists"-template so that after this template has checked whether a page exists or not, another template (a template with preload-parameter for a new page or a template without preload-parameter for an existing page) is returned:
=> The original qif-code of the {{exists}}-template is: {{qif |test={{booleq |1=[[{{ucfirst:{{{1|defaultFalse}}}}}]] |2={{:{{{1|defaultFalse}}}}} }} |then={{{else|false}}} |else={{{then|true}}} }}
=> I tried to adapt this into: {{qif |test={{booleq |1=[[{{ucfirst:{{{1|defaultFalse}}}}}]] |2={{:{{{1|defaultFalse}}}}} }} |then={{{else|{{hotspot || Image = image-name.gif | Link = name-of-the-page |Preload=Template:templatename | Heigth = 81px}}}}} |else={{{then|{{hotspot-no-preload || Image = image-name.gif | Link = name-of-the-page | Heigth = 81px}}}}} }}
Unfortunately, I want to apply this to several different images, each of which links to a different page so i should have to put this qif-code into different {{exists}}-templates so that each of these different {{exists}}-templates then contains its own "image-name.gif"-reference and "name-of-the-page"-link. This is not efficient because lots of {{exists}}-templates have to be made.
A little bit more efficiently: I could put this qif-code on the wiki each time such an image should be displayed, but i do not understand how the name-of-the-page-parameter can be passed to this qif-code without referring to a global template like {{exists|name-of-the-page}}. What i mean is that when the {{exists}}-template is used, the parameter is passed by {{exists |name-of-the-page}} and then the qif-code knows which page to check. What i would like to accomplish now, is to adapt the qif-code so that i can manually define in the qif-code which page should be checked for existence.
In short: how do i adapt the above qif-code, so that it knows what page to check for existence, without passing the name-of-the-page-parameter via {{exists|name-of-the-page}}??
Thanks a lot in advance!
JAN
2006/4/5, Minh Nguyen mxn@zoomtown.com:
Yes, I think there is: the English Wikipedia has an "exists" template http://en.wikipedia.org/wiki/Template:Exists to check if a particular page has been created yet.
Jan Vanoverpelt wrote:
2006/4/4, Jan Vanoverpelt
Thank you all for the help: it works now!
...BUT 1 practical problem is still there: Scenario:
- The user clicks on an image, which refers to a non-existing page.
- The user is linked to the non-existing page's edit-box in which the
preloaded text is written. 3) The user adds some additional text and saves the page. 4) The user leaves the pages, surfs around on the wiki and goes back
to the
image through which he previously created the new page. This is the
point
where the practical problem jumps in: the user clicks on the image,
BUT he
is AGAIN taken directly to the edit-box INSTEAD OF being taken to the
actual
page (which exists now, so he does not have to be linked directly to the edit-box of the page).
I think this problem is due to the fact that i have created some kind of "hard link" behind the image, so that the user is always forced to go directly to the edit-box with the preloaded text in it. Is there a way
to
fix this, so that the user (after he/she visited the non-existing
page for
the first time, added something and saved it) is directly taken to the actual page the second time (like is done in case of "normal" links) ??
Thanks!
JAN
-- Minh Nguyen mxn@zoomtown.com AIM: trycom2000; Jabber: mxn@myjabber.net; Blog: http://mxn.f2o.org/
Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Minh Nguyen wrote:
Jan Vanoverpelt wrote:
I think this problem is due to the fact that i have created some kind of "hard link" behind the image, so that the user is always forced to go directly to the edit-box with the preloaded text in it. Is there a way to fix this, so that the user (after he/she visited the non-existing page for the first time, added something and saved it) is directly taken to the actual page the second time (like is done in case of "normal" links) ??
Yes, I think there is: the English Wikipedia has an "exists" template http://en.wikipedia.org/wiki/Template:Exists to check if a particular page has been created yet.
Eww! That's clever, but also incredibly ugly. I can see why a template (or a parser function) for this might be useful, but Jan's problem would be much cleanly solved by a small patch to MediaWiki.
A minimal patch would be to add a new action ("action=editnew"?) that would act like "action=edit", but only if the page does not already exist.
A slightly more invasive solution would be to show the edit box even in the absence of "action=edit" if the page does not exist and the preload parameter has been given. This would avoid the need for a new action, and the presence of the preload parameter seems a fairly good indication that page creation is desired.
A radical, but simple, solution would be to show the edit box for _all_ nonexistent pages, with or without "action=edit". After all, all MediaWiki-generated links to nonexistent pages already do have "action=edit" included.
The last suggestion would probably require some special handling for blocked users, since we don't really want to trigger an autoblock just because a blocked user clicked what he thought was a bluelink. This is related to Bug 4990, which apparently has been marked WONTFIX "for caching reasons". I realize this is going off on a tangent, but could someone who understands that comment (Brion? Rob?) explain it to me?
wikitech-l@lists.wikimedia.org