Viewing 2 reply threads
  • Author
    Posts
    • #2504
      Jason
      Keymaster

      Greetings!

      I just ran into an interesting case where I’d like to change the meta-boxes for the default page template. Currently you can target a page template, or you can target the page post type. The problem with using the post type is that it applies to all page templates. On the other hand there is not “template” for the default template; it’s the absence of a template.

      It’d be awesome to have a “Default” keyword for the template property. So one could target Template: Default.

      For the internals, the best way to determine the default page template is to do:
      if ( is_page() && !is_page_template() )

      Thanks!

    • #2505
      Steve
      Keymaster

      @jasonWould this tutorial help? It’s the opposite of what you want, but should get you started.

    • #2506
      Jason
      Keymaster

      @steve- Hmm.. well, I actually just added this to the Piklist core. I was more curious than anything. I’ll email this to you. You’re welcome to use it if you and Kevin feel that could be a reasonable part of the core. If you’d rather not use it, then I’ll just add this functionality to the PiklistHelper class.

      I was thinking about the ‘piklist_add_part’ hook, but it didn’t occur to me to do $data[‘role’] = ‘no-role’ as a way of tricking Piklist into not showing it. To be honest, that feels a bit clunky to me. Why not allow the user to return false and add an if ( false === $data ) return; after the apply_filters?

      Thanks!

      ~Jason

Viewing 2 reply threads
  • You must be logged in to reply to this topic.