Jump to content

Specify Multiple Child Templates


Pete
 Share

Recommended Posts

Hi guys

I do like the ability to be able to set the choice of child template for children of a given page based on the parent template (hope you're still with me), however I've had a couple of occasions where I would have liked to be able to set the option for more than one choice of template for a set of child pages but not necessarily the whole list of templates (I have lots of templates).

Would it be possible in a future version to be able to select more than one template for child pages of a given page's template, and if so it would also be nice - but not essential - if you could still set a default from that list.

Link to comment
Share on other sites

Pete, we must be on the same wavelength because I actually added this feature to the P21 source yesterday. :) See the latest commit.

In addition, you can also specify multiple 'required parent templates' should you want to. For instance, if you only wanted it to be possible to add news-item pages below a news-archive page.

Link to comment
Share on other sites

Just a quick one here - I think when you then go to add a child page, the template list should reflect the order you have them in when specifying possible templates.

I've got a slight issue where there are 3 possible child templates, gallery_home, gallery and page, and page would be the most commonly used child template, yet the list is in alphabetical order no matter what order I drag those fields into when specifying the choice of templates.

I guess in many situations it would make sense to have it alphabetical if you're specifying a lot of child templates, so perhaps have a checkbox when specifying child templates to allow the admin to specify that the list should appear alphabetically instead of the order they are in the list, or vice-versa if you think alphabetical ordering should be the default?

Link to comment
Share on other sites

I think that makes sense. If they've specified certain child templates as allowed in the template settings, then I think it should follow what ever order they've specified. Whereas alpha order makes sense if they haven't specified anything. But since the order is sortable in that part of the template editor, we might as well retain it. I've added this to the GitHub issues list.

Thanks,

Ryan

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...