Jump to content

"Name format for children" option for Template which has more than 1 allowed children templates


Orkun
 Share

Recommended Posts

Hi

I have a question about the "Name format for children" option for Templates. This option only shows up when i allow 1 single template under the "allowed templates" option.

The Scenario: I have a template called "activity", the activity template can have or it is allowed only to have 4 template types as children: date, cast, image and video. My Problem is that i want that only the page name of the date pages are genereated automatically with the "Name format for children". But this option is only working when i allow only 1 template as children.

How can I achieve, that  the "Name format for children" works also when its allowed more than 1 children.

Here is the Tree structure for visualization:

post-3125-0-31232400-1446111925_thumb.pn

Link to comment
Share on other sites

Maybe that can work, but haven't tested:

you can create another parent template, (as a copy from your current),  but only the template in PW backend, not with a template file!!

than you assign your current templatefile to the new template under Template Edit _> Files -> "Alternate Template File",

as children, you only assign that date template, with setting the auto name format

I think you have to experiment with it, so highly recommend to do this in a playground install, not in your current projects install !!

:)

Edited by horst
Link to comment
Share on other sites

Not possible. But you can set automatic page name format on your PageTable field setting under tab input, and not on the parent template family settings.

That's only for none or for all templates in the pagetable field. But I guess it doesn't matter.

  • Like 1
Link to comment
Share on other sites

@horst

Thank for your answer. I tried your idea but unfortunately it hasn't worked.

@Soma

I saw that option for the PageTable before, I also set it but i also need this option for the parent template. The users can create dates with the pagetable while they are creating a activity but they can also create dates with the date Lister. Is it really not possible? also not with hooks like mentioned in this thread here: https://processwire.com/talk/topic/10701-automatic-page-name-using-processpageaddexecute-and-pagetable/

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...