Hello
I don't want my users to learn the substitution syntax (http://www.mediawiki.org/wiki/Manual:Substitution ) so I want to hide it inside a template, e.g. Template:now
<includeonly>{{safesubst:LOCALTIME}}</includeonly>
But that doesn't work as wanted and come to think of it might not be possible at all. Or am I missing something?
I too would be interested in knowing if somehow we can get rid (hide) 'subst:' keyword. Most of the regular users get stumped when I tell them to use subst:<template-name> after picking up a template from the drop down list of FCKEditor.
Any way to make it more user friendly?
nakohd: You cannot make some templates subst by not using subst.
Tech Geek case is easier, since FCKEditor could automagically prepend subst: to some templates.
Both cases require touching code, though.
Platonides,
since FCKEditor could automagically prepend subst: to some templates.
That's great as I exactly want this same behaviour. Can you tell us what modifications are to be made? Let's say I have templates named "Stardard" and "EvalForm" and I want that any time a user selects these templates from the FCK Editor the keyboard "subst" is automatically prepended.
Thanks!
Tech Geek wrote:
That's great as I exactly want this same behaviour. Can you tell us what modifications are to be made? Let's say I have templates named "Stardard" and "EvalForm" and I want that any time a user selects these templates from the FCK Editor the keyboard "subst" is automatically prepended.
Have a look at: http://www.mediawiki.org/wiki/Manual:Custom_edit_buttons http://en.wikisource.org/wiki/Wikisource:Tools_and_scripts/More_editing_butt...
hth Frank
nakohdo wrote:
Have a look at: http://www.mediawiki.org/wiki/Manual:Custom_edit_buttons http://en.wikisource.org/wiki/Wikisource:Tools_and_scripts/More_editing_butt...
You'll find actual buttons at http://commons.wikimedia.org/wiki/Mediawiki_edit_toolbar
Add the following JavaScript to your wiki's MediaWiki:Common.js (or another JS file):
if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/35/Button_substitute.png", "speedTip": "Substitution", "tagOpen": "{{subst:", "tagClose": "}}", "sampleText": 'Template to be substituted'}; };
(For production use please change the imageFile URL to one on your own server.)
Platonides wrote:
nakohdo: You cannot make some templates subst by not using subst.
Thanks for clarification. Yes, a thought reading parser is still on my wishlist ;-)
A follow-up question, though: Technically speaking "subst:" is a parser function, isn't it? Could I a least create an alias for it (by modifying magic words?) which is more meaningful for non English speakers?
tia Frank
nakohdo wrote:
Platonides wrote:
nakohdo: You cannot make some templates subst by not using subst.
Thanks for clarification. Yes, a thought reading parser is still on my wishlist ;-)
A follow-up question, though: Technically speaking "subst:" is a parser function, isn't it?
Not exactly a parser function. I would call it a /modifier/ for templates/parser functions.
Could I a least create an alias for it (by modifying magic words?) which is more meaningful for non English speakers?
tia Frank
You are not expected to translate it. You would need to modify includes/MagicWord.php *and* the literal comparison in includes/parser/Parser.php at braceSubstitution()
Platonides wrote:
Technically speaking "subst:" is a parser function, isn't it?
Not exactly a parser function. I would call it a /modifier/ for templates/parser functions.
Could I a least create an alias for it (by modifying magic words?) which is more meaningful for non English speakers?
You are not expected to translate it. You would need to modify includes/MagicWord.php *and* the literal comparison in includes/parser/Parser.php at braceSubstitution()
Thanks, Platonides, for those glimpses into the inner workings of MediaWiki. I have opted for your suggested solution of adding respective buttons to the WYSIWYG editor which IMO is better than tampering with core files ;-)
I'm trying to use Special:Import to create several pages at once. The catch is that these are brand-new pages that were not exported from another wiki. The XML syntax seems pretty straight forward, but I had a few questions.
Here is a snippet of the Exported XML from an existing page: <page> <title>Category:2.0 Feedback Survey</title> <id>2407</id> <revision> <id>11369</id> <timestamp>2010-12-02T02:18:23Z</timestamp> <contributor> <username>Niklasn</username> <id>84</id> </contributor> <comment>Created page</comment> <text xml:space="preserve">blah blah blah</text> </revision> </page>
My question is when importing a brand-new page what should I put for the page id and what should I put for the revision id? Or if I leave these fields out, will MediaWiki create default values?
If it helps, the version of MediaWiki I'm importing into is 1.11.2.
You can skip all the "id" fields when importing. I do this all the time.
DanB
On Thu, Jan 20, 2011 at 5:52 PM, mrthetooth mrthetooth@burningsea.comwrote:
I'm trying to use Special:Import to create several pages at once. The catch is that these are brand-new pages that were not exported from another wiki. The XML syntax seems pretty straight forward, but I had a few questions. [snip] My question is when importing a brand-new page what should I put for the page id and what should I put for the revision id? Or if I leave these fields out, will MediaWiki create default values?
You can safely leave them out. When using Special:Import, any ID numbers listed in the XML data will actually be ignored; pages and revisions will receive their own local ID numbers when saved in the local database.
The page, revision, and user ID fields are in the export for reference, and for bulk dump/restore tools that operate on full-site data dumps as they may need to reproduce the original site's ID values for convenience of data processing. Important if you're restoring a site backup or processing a Wikipedia data download, but safely ignorable for your case. :D
-- brion
mediawiki-l@lists.wikimedia.org