Short description

A really simple feature here - a default Template page that would be used for all new pages where a more specific template is not specified.

Patch

--- MoinMoin.orig/PageGraphicalEditor.py
+++ MoinMoin/PageGraphicalEditor.py
@@ -192,6 +192,11 @@
        if preview and raw_body:
            self._make_backup(raw_body)

+       # Try to load content from Tempate page for a new page
+        if not raw_body:
+           if self.request.user.may.read('Template'):
+               raw_body = Page(self.request, 'Template').get_raw_body()
+
        # Generate default content for new pages
        if not raw_body:
            raw_body = _('Describe %s here.') % (self.page_name,)

And the same change in PageEditor.py . As far as I see, this change has no side effects besides from the primary effect of loading the content from the Template page (if such exists and is readable) for any new pages where a template was not specified otherwise.

Could that be added to further MoinMoin versions?

The code is now used live on FFII.org.


Q: How does that "where a more specific template is not specified" work exactly? If you go to a nonexisting page, moin usually shows you a list of template pages to create the new page from (including an "empty page" option that creates an almost empty page). So when does the default template get used exactly?

A: When you choose 'create empty page' instead of a specific template.


I would love to see this feature added. I could create my own EmptyPageTemplate and choose it whenever I would have previously chosen "create empty page", but that's not as elegant as being able to customize the template used by the "create empty page" action. This could also be really helpful in a multi user environment where each page should contain some customizations, like a copyright or a link to a company main page or whatever. CategoryFeatureRequest

MoinMoin: FeatureRequests/DefaultTemplateForNewPages (last edited 2008-07-11 18:12:48 by 63-226-197-82)