Description
When creating a homepage using HomepageTemplate, the automatic substitution for the user's name does not take place. Consequently, users will probably end up re-editing their page once they see that the heading is @``ME@ rather than a form of their name.
Steps to reproduce
Create a new page, choosing HomepageTemplate as the basis of the page.
- Edit the page, but leave the heading unchanged.
- Save the page.
Example
Here's the offending markup:
== @``ME@ ==
Component selection
Although the substitution is done in MoinMoin.PageEditor, it's the template that contains the invalid substitution variable name.
Details
MoinMoin Version |
1.8.3 |
OS and Version |
moinmo.in |
Python Version |
moinmo.in |
Server Setup |
moinmo.in |
Server Details |
moinmo.in |
Language you are using the wiki in (set in the browser/UserPreferences) |
English (United Kingdom) |
Workaround
Just change the new page so that the substitution can be made, using @ME@ in the heading.
Discussion
It looks like the substitution is deliberately blocked through the use of the additional characters: this would prevent the expansion happening when saving the template in MoinMoin itself, but then the extra characters never go away. So when the template is copied and edited, the characters remain and block further substitution attempts when really, the characters should be removed before the template is used.
Maybe just writting "YourName" in the template (instead of @``ME @) would be enough. The @``ME@ confused me yesterday too (when I created the homepage ThomasWaIdmann
). Most people don't know that variable stuff at all. I'm personally looking forward to seeing some vCard/hCard parser implemented (I think there was already some Google project on that). Having a homepage template with a prefilled vCard/hCard parser would make more sense to me. -- OliverSiemoneit 2009-05-30 22:03:53
Anywway we need the right page_template_regex on the master wikis to solve this. With the current one template pages only for english won't expand these variables by saving. -- ReimarBauer 2009-05-31 07:55:04
I've just changed the workaround so it doesn't substitute my name but instead shows the substitution variable that one would actually enter. I did actually dig around in the code and saw that substitution should not happen when saving template pages (there's a call to wikiutil.isTemplatePage(request, self.page_name) in MoinMoin.PageEditor.saveText, so it should have been possible to put the raw form of the variable rather than a protected form of it (which I've had to use above, too). -- PaulBoddie 2009-06-06 21:07:26
Template pages are created on master wiki's. Currently we use a regex there which does cover only en template pages. if a translator would translate a @ME@ (given the string without the double `) it would expand on their template pages, see also FeatureRequest/Know_Alien_Template_Pages
Maybe adding a specific header (##IsTemplate) could help with this. When this header is present, the document would be used as a template (no var instanciation). It should be simple enough to automatically remove it when the page is used to create a new document. -- -- JeanPhilippeGuérard 2010-07-25 16:33:42
Plan
- Priority:
- Assigned to:
Status: finding the regex was promised by ReimarBauer