Viewing 6 reply threads
  • Author
    Posts
    • #4859
      irene
      Member

      Hello,
      For my plugin, which function is just to input data (names, birthdates), but with the possibility of taxanomies and relations.
      I am wondering if it is possible to hook, or call in, an cpt and all the metaboxes, etc. created with Piklist in an new, and thus blanco admin page.
      If so, how can I accomplish this? Would be very grateful… Just can not figure this one out by myself 🙂
      Thanks in advance,
      Irene

    • #4872
      Steve
      Keymaster

      @irene– I’m not 100% clear on your need. Please give a little more details or provide a screenshot.

    • #4877
      irene
      Member

      Hallo Steve,
      What I would like to do is:
      Create a custom post type with show_ui => false with piklist (have already done that), create a new admin page (blanco) with menu on top level and create a custom edit post page for this cpt.
      I would like to have the user post layout, tried using the user post at first but I just want to input dog names, b-day etc… for later use, no need for log-in, password, e-mail etc…

      Recapitulating:

      Is there is a way where i can create my own edit.php page from scratch for my custom post type with the use of Piklist?
      I Understand I need to create a cpt and set show_ui to false and construct an interface for the CPT just as for an plugin admin page. But I do not understand how I can than refer to the cpt inside this admin page, make the metaboxes and workflow’s appear on this new admin page and save the meta data to the cpt….

      Very Grateful if you could help me…

      Irene

    • #4884
      Steve
      Keymaster

      @irene– There are two ways to do this in Piklist:
      1) The piklist function can work in any file, so you can use this outside the /parts/ folder:

        piklist('field', array(
          'type' => 'text'
          ,'field' => 'text'
          ,'label' => __('Text', 'piklist-demo')
          ,'help' => __('You can easily add tooltips to your fields with the help parameter.', 'piklist-demo')
          ,'attributes' => array(
            'class' => 'regular-text'
          )
        ));
      

      2) In the latest Beta, you can use a Piklist form. Take a look at these two files:
      The form.
      Embedding the form

      You can get the latest beta here>

      Let us know if you need any help with this.

    • #4932
      irene
      Member

      Hello Steve,
      Thanks for answering my question.
      I have downloaded the new beta and have read and looked at the code, but, maybe I have overlooked it or just because I am new to developing, I can not find a piece of code where I can refer to my custom post type on a blanc Admin page.
      If I place a form on the blanc admin page how can I then save the data to the correct custom post type (dog in my case), or is it not necessary to save to a particular post type to be able to make for example a profile page…, and relations (parent, children…)

    • #4944
      Steve
      Keymaster

      In the latest beta take a look at this file:
      wp-content/plugins/piklist/add-ons/piklist-demos/parts/forms/new-post-with-validation.php

      This is a form that creates a new post. You’ll notice the first field is hidden but sets the post_type to piklist_demo. You would just change that to dog.

       piklist('field', array(
          'type' => 'hidden'
          ,'scope' => 'post'
          ,'field' => 'post_type'
          ,'value' => 'dog'
        ));
      

      To include this form in your admin-page, you would use this code:

        piklist('form', array(
          'form' => 'new-post-with-validation' // name of the file without .php
        ));
      

      Does that make sense?

    • #4953
      irene
      Member

      Steve: 🙂
      Thank you!!!!!
      Got it! Now figure out the rest 🙂

      Irene

Viewing 6 reply threads
  • The topic ‘Is it possible to hook a cpt to a custom admin page with piklist’ is closed to new replies.