Sipho Posted July 13, 2017 Share Posted July 13, 2017 I wish to access a template's allowed templates for it's children from the API. This one: I am pretty sure this is possible, but I can't seem to find it anywhere in the documentation. If this is not possible, is there some way of assigning properties to templates? So like fields that already have a value on all pages using that template. Link to comment Share on other sites More sharing options...
tpr Posted July 13, 2017 Share Posted July 13, 2017 $template->childTemplates? Link to comment Share on other sites More sharing options...
Sipho Posted July 13, 2017 Author Share Posted July 13, 2017 @tpr Yep that's worked. It returns the ids in an array. How did you find that out? I couldn't see it anywhere in the documentation. Link to comment Share on other sites More sharing options...
tpr Posted July 13, 2017 Share Posted July 13, 2017 I needed this when one of my modules installed a few templates, I digged into the core as I remember. Link to comment Share on other sites More sharing options...
Sipho Posted July 13, 2017 Author Share Posted July 13, 2017 @tpr Ah, I found it in the database. I will keep that in mind when I want to know another property. But why isn't stuff like this documented? Is there any way people can contribute to the documentation? Link to comment Share on other sites More sharing options...
LostKobrakai Posted July 13, 2017 Share Posted July 13, 2017 8 minutes ago, Sipho said: But why isn't stuff like this documented? How about that? https://processwire.com/api/ref/template/ Link to comment Share on other sites More sharing options...
Sipho Posted July 13, 2017 Author Share Posted July 13, 2017 @LostKobrakai Well this is embarrassing . I will look harder next time. Link to comment Share on other sites More sharing options...
Sipho Posted July 13, 2017 Author Share Posted July 13, 2017 Oh my goodness that page is so obvious. I don't know how I missed it. Sorry for wasting your time! Link to comment Share on other sites More sharing options...
kongondo Posted July 13, 2017 Share Posted July 13, 2017 Another trick as mentioned by @Robin S somewhere I now can't find...Hover your mouse over the field's collapse/uncollapse arrow...the name of the input usually matches the API... 1 Link to comment Share on other sites More sharing options...
Sipho Posted July 13, 2017 Author Share Posted July 13, 2017 @kongondo For some reason I can't get that to show up. When I hover my mouse over it it just says "Toggle open/close". Link to comment Share on other sites More sharing options...
kongondo Posted July 13, 2017 Share Posted July 13, 2017 22 minutes ago, Sipho said: For some reason I can't get that to show up. When I hover my mouse over it it just says "Toggle open/close". Hmm. What version of PW? It shows for me in 2.7 and 3.0.62. Link to comment Share on other sites More sharing options...
Sipho Posted July 13, 2017 Author Share Posted July 13, 2017 @kongondo Version: 3.0.62 Site modules: AdminOnSteroids ImageExtra ImportPagesCSV JqueryDataTables ModulesManager Theme: Reno Link to comment Share on other sites More sharing options...
rick Posted July 13, 2017 Share Posted July 13, 2017 Not sure but I seem to recall reading that either debug mode or advanced mode triggered the field name display when hovering. 1 Link to comment Share on other sites More sharing options...
Robin S Posted July 13, 2017 Share Posted July 13, 2017 @Sipho, the name tip only appears if $config->debug = true 2 Link to comment Share on other sites More sharing options...
Sipho Posted July 13, 2017 Author Share Posted July 13, 2017 @Robin S @rick Yep that worked. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now