felleb
felleb

Reputation: 23

Save Page Forms' »unique number« into Semantic Mediawiki property

I use the Mediawiki Page Forms extension to create pages and set their names with a »page name« parameter like

{{{info|page name=<My Template[Some property]>-<unique number;start=1>}}} (see here for details).

Is there a way to save that »unique number« into a Semantic MediaWiki property of the created page for later usage by SMW queries?

Upvotes: 0

Views: 174

Answers (1)

Robis Koopmans
Robis Koopmans

Reputation: 408

You could do something like this if you have Extension:ParserFunctions installed

Add to your template:

{{#set:
|unique number={{#explode:{{PAGENAME}}|-|-1}} 
}}

this explodes the page name on '-' and takes the last part

See more on the PAGENAME magic word here: https://www.mediawiki.org/wiki/Help:Magic_words#Page_names

See more on the explode parser function here: https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#explode

Upvotes: 1

Related Questions