Dear SMW users,

I have created a small extension, AutoCreatePage [1], that makes it 
possible to create "helper" pages by adding parser functions to one 
page. I think this is especailly useful for SMW (and SF) users, so I 
post it here.


How it works
============

You insert wikitext like the following into a page:

{{#createpageifnotex:Another page|Content for the page}}

When you safe the page, a new page "Another page" is created and its 
initial content is set to "Content for the page". This only happens if 
there is no page of that name yet. Pages are only created when saving an 
edit, not on preview or view. You can use <nowiki> in the content part 
to insert templates, ask queries, and other "active" wikitext. The 
creation of the page is attributed to the user who made the edit. 
Created pages are prevented from creating further pages in the same edit 
(health and safety).


Why you would want this
=======================

When using SMW and Semantic Forms to create a pages, it can be useful to 
create several pages at once. For example, you could keep some long 
query results on their own page, or you could even create versions of 
the page in several languages (one is used as the master copy of all the 
data, and other language versions of the page use SMW to fetch information).

Normally, you would have to do this manually, even if the additional 
pages contain only templates and queries (which do not need any further 
user input to be created). With this extension, you can have templates 
(and forms) that create their own helper pages (and maybe link to them).

This is used heavily on the AIFB Portal [2]. My code is based on their 
original code, but most of it was rewritten to work with MediaWiki 1.23 
(in a cleaner way).


Credits
=======

The original idea and code is due to Daniel Herzig. I just modernized 
and simplified the code.


Future
======

I just put this quickly on github to share it with others. If you like 
it, consider adopting the code (it is very short, only 100 lines). It 
would be good to move it to gerrit at some point to have 
internationalization of the three messages that it uses. Right now, the 
code should be considered in beta state, though I am not aware of any 
issues.


Cheers

Markus

[1] https://www.mediawiki.org/wiki/Extension:AutoCreatePage
[2] http://www.aifb.kit.edu/

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to