Possible to let a Template define the title of the new page?

See title. We have some users, who would like to structure their blog entries using the current date as part of the title, and they would like that to be automatically provided when they are using a certain template.

Is that possible ? As far as I know, a template can only define the content of the page of which it is to be inserted to, but not the title? Am I missing something ?

A template can have a title set. When a new page is created from a template, the template document is copied (thus its title is also copied).

Now, the problem is that the Create dialog always overwrites the title to be the one set by the user in the UI…

At the technical level the URL called is for example the following for the Encyclopedia Template: `http://localhost:8080/xwiki/bin/edit/aaa/WebHome?template=Templates.Encyclopedia.Template.WebHome&parent=Main.WebHome&title=tttt&form_token=xxxx``

Notice the passing of the title parameter.

If you create such a URL manually and remove the title parameter, the template title would be used, for example: http://localhost:8080/xwiki/bin/edit/bbb/WebHome?template=Templates.Encyclopedia.Template.WebHome&parent=Main.WebHome

I guess we would need an advanced option (checkbox) to use the template title or not. Feel free to create a jira issue at https://jira.xwiki.org

Thx

1 Like

I opened Loading...

1 Like