Viewing 11 reply threads
  • Author
    Posts
    • #5622
      ananse
      Member

      <?php
      /*
      Title: My custom fields
      Post Type: post, page
      */

      piklist(‘field’, array(
      ‘type’ => ‘text’
      ,’field’ => ‘field_one’
      ,’label’ => ‘First Field’
      ));

      the code above is what i’m using on Xampp 5.6.15-1
      Wordpress 4.4.1 Theme 2014: the last line

      ,’label’ => ‘First Field’

      just throws errors, if I remove it , no errors.

      Wordpress 4.4.1 Theme 2015: the last line
      Everything that should display just disappears completely with no errors?

      Am I doing something really stupid?

      Can some please help?

    • #5624
      ananse
      Member

      oops…
      the error is as follows

      Parse error: syntax error, unexpected ‘One’’ (T_STRING), expecting ‘)’ in /Applications/XAMPP/xamppfiles/apps/wordpress/htdocs/wp-content/themes/twentyfourteen/piklist/parts/meta-boxes/my-fields.php on line 10

    • #5625
      ananse
      Member

      such an idiot,

      should remembered this, using textedit.app on a mac does not write the correct quotes!

      Sooooooooooo sorry for waisting time 🙂

    • #5626
      ananse
      Member

      Ok, I spoke to soon,

      For the life of me I can’t find these “My Custom Fields” , even though everything seems to be working.
      that’s step (6) – Utilising the same code everywhere on WordPress 4.4.1

    • #5630
      Steve
      Keymaster

      @ananse– Welcome to the Piklist community!

      We’re here to help! It might be faster is you email your plugin to use to review. You can zip it up and send to [email protected]

      Please refer to this page url

    • #5634
      ananse
      Member

      I’m not sure what you want me to zip up.
      Its not a special plugin I just downloaded wordpress 4.4.1 today, downloaded your plugin afterwards followed the tutorial.

      Its a blank wordpress 4.4.1 no posts, no comments, no installed plugins.

      It would be easier for me if there was a snapshot of what screen / Tab of the Users Profile of WordPress 4.4.1 , I should be seeing “my custom fields” (STEP 6 only – steps 1-5 work just fine) , unless it hasn’t been tested on WordPress 4.4.1 yet.
      thanks

    • #5636
      Steve
      Keymaster
      This reply has been marked as private.
      • #5640
        ananse
        Member

        Thanks Steve for your reply and taking the time to help:
        I’m using only themes at the moment.

        I hope the reply button on a comment/post marked private, makes this reply private: anyway

        Copying from Aptana Studio:

        (1) This code is in a file called my-fields.php, and my-fields.php is in themes/twentyfourteen/piklist/parts/users/my-fields.php
        (2) With the piklist installed and demos turned on, when you visit a subscriber profile there are Tabs.
        “Default” “General” “Basic” “Lists” “Groups” “Advanced” “Validation” “Conditions”

        scrolling down the page on each does not seem to show any header field block reflecting any custom fields as per the code below – what I am searching for is the same thing/screenshot I saw in the tutorial (step 5) , but somewhere under one of the tabs I mentioned in (2), is that wrong?

        <?php
        /*
        Title: My Custom Fields
        *
        */

        // 1st field
        piklist(‘field’, array(
        ‘type’ => ‘text’
        ,’field’ => ‘field_one’
        ,’label’ => ‘FirstField’

        ));

        // 2nd field colour picker
        piklist(‘field’, array(
        ‘type’ => ‘colorpicker’
        ,’field’ => ‘field_two’
        ,’label’ => ‘Second Field’
        ));

      • #5641
        Steve
        Keymaster
        This reply has been marked as private.
    • #5654
      ananse
      Member

      Hi Steve,

      done.

      • #5663
        Steve
        Keymaster

        @ananse– If I understand correctly, when the Piklist Demos are turned on, you can’t find your field code on the user profile page, correct?

        The Demos are just demos. You shouldn’t have them on in production. Feel free to turn them off.

        But if you want your code to show up, you need to assign it the Workflow system(tabs) being loaded on the User Profile page. Add this to the comment block of /users/my-fields.php:

        Tab: Common
        Sub Tab: Profile
        Flow: Demo Workflow
        
    • #5666
      ananse
      Member

      Hi Steve,
      Thank you so much…So I added your code below and it worked, only if I turned off the Demo Plugin(s).

      (a) If I understand this correctly, you can’t add to the demos, you have to make copies (and place them some where in the piklist folder tree.)

      Sorry in advanced if this is a dumb question…
      (b) What I would like a little help with, is on your website the “User Guide”, could you please point me to the chapter/tutorials that would help me read-up on how to DIY my own tabs any where in WORDPRESS like the ones below? Or maybe it doesn’t quiet work like that and I’m suppose to copy and paste code from the demos?

      I would like to make these and follow tutorials and add “things” to my own DIY tabs.

      “Default” “General” “Basic” “Lists” “Groups” “Advanced” “Validation” “Conditions”

      <?php
      /*
      Title: My Custom Fields
      Tab: Common
      Sub Tab: Profile
      Flow: Demo Workflow
      *
      */

    • #5670
      Steve
      Keymaster

      @ananse– Glad it worked!

      (a) You can add to the Piklist Demos if you want…but I wouldn’t recommend it. They are designed to be demos, that’s it. We change them all the time to show off new Piklist features.
      (b) If you want to make Tabs yourself, check out this article. You can then use the Demos as a guide, since they are built the same way. You can even copy and paste the code from the demos into your own project, and then just change a few things.

      Hope that helps.

    • #5734
      ananse
      Member

      Hi Steve,

      I have tried to add the Tabs but no joy. Turned off the demos plugin and the files from the first part of the tutorial I can still see working…If I understand the system correctly, the file names do not matter, only the declarations at the top of each file…Also
      “All Workflow files go in the /workflows folder.” I followed this to the letter, but no joy.
      User guide comment suggests that unlike the first tutorial we discussed, all the files go into the workflow folder including the Meta Box File for the fields in step (3) for workflows.

      Continuing with the tutorial: Worklflows

      I created three files,
      (1) Header file = wf_posts_header.php
      (2) Tab File = wf_posts_tabs.php
      (3) Meta File = wf_my_flow_fields.php

      files (1) and (2) placed in the folder workflows, the third I tried in two places:
      (a) the same folder as (1),(2)”workflows”, but No Tabs showed up anywhere.
      (b) then tried placing Meta File into the meta-boxes folder, because I thought maybe I should apply the same structure as the first tutorial, but still NO tabs showed up anywhere.

      I cannot figure out what I am doing wrong…please can you help?

      (1) Header file looks like this: “1) Header”
      =============================
      <?php
      /*
      *
      * Flow: My Flow
      * Page: post.php, post-new.php, post-edit.php, admin.php
      * Post Type: my_cpt
      * Header: true
      * Position: title
      * */
      ?>
      (2) Tab File looks like this “2) Tab”
      ==============================
      <?php
      /*
      *
      * Title: My Tab
      * Order: 10
      * Flow: My Flow
      *
      */

      ?>

      (3) Meta File Looks like this: “3) Assign Meta Boxes, Sections, Etc. to Workflows.”
      ==================================

      <?php
      /*
      Title: My Flow Custom Fields
      Post Type: post, page
      Tab: My Tab
      Flow: My Flow
      */

      // 1st field
      piklist(‘field’, array(
      ‘type’ => ‘text’
      ,’field’ => ‘field_one’
      ,’label’ => ‘Flow First Field’

      ));

      // 2nd field colour picker
      piklist(‘field’, array(
      ‘type’ => ‘colorpicker’
      ,’field’ => ‘field_two’
      ,’label’ => ‘Flow Second Field’
      ));

      ?>

      • #5747
        ananse
        Member

        Hi Steve,
        I have made some progress…but still having problems…

        I changed the files as follows…and I get 2 tabs when I view/edit a “POSTS”. Note.. the Order from left to right
        (a) 1st Tab Title= “My Flow Custom Fields” with two fields, from tutorial 1
        (b) 2nd Tab Title= “My Objective Tab” with no fields, but it represents the Meta file (3) below…

        (Q1) Why is the “My Objective Tab” (1) from the Meta-File appearing as a separate TAB on its own with no fields… it has the same Name as the Tab I specified in (2) ?

        (Q2) Do I have to create 3 additional similar files for “PAGES” i.e (1) (2) (3), even if I want to use the same exact fields in “POSTS” and “PAGES” ?

        (Q3) Forgive me, but I don’t know how to create the ‘my_cpt’, i.e what does it mean in the USER-GUIDE
        Post Type
        For custom post type flows, please define the post type. Example: my_cpt ”

        How do you create this custom post, is there an example, So that I can finish this tutorial on workflows?

        (1) Header file looks like this: “1) Header”
        =============================
        <?php
        /*
        Flow: My Post Flow
        Page: post.php, post-new.php, post-edit.php, admin.php
        Post Type: post
        Header: true
        Position: title

        */
        ?>

        (2) Tab File looks like this “2) Tab”
        ==============================
        <?php
        /*
        Flow: My Post Flow
        Title: My Objective Tab
        Order: 10
        Page: post.php, post-new.php, post-edit.php, admin.php
        Default: true
        */
        ?>

        (3) Meta File Looks like this: “3) Assign Meta Boxes, Sections, Etc. to Workflows.”
        ==================================
        <?php
        /*
        Flow: My Post Flow
        Title: My Flow Custom Fields
        Post Type: post, page
        Tab: My Objective Tab
        */

        // 1st Flow field
        piklist(‘field’, array(
        ‘type’ => ‘text’
        ,’field’ => ‘field_one’
        ,’label’ => ‘Flow First Field’

        ));

        // 2nd flow field colour picker
        piklist(‘field’, array(
        ‘type’ => ‘colorpicker’
        ,’field’ => ‘field_two’
        ,’label’ => ‘Flow Second Field’
        ));
        ?>

    • #5754
      ananse
      Member

      Hi steve,
      Please ignore “(Q3) Forgive me, but I don’t know how to create the ‘my_cpt’, i.e what does it mean in the USER-GUIDE
      “Post Type
      For custom post type flows, please define the post type. Example: my_cpt ” ”

      because – thanks to your groups video “https://www.youtube.com/watch?v=9s0b6-YV_UM&#8221;, I think I can work that part out.
      cheers

Viewing 11 reply threads
  • The topic ‘First Tutorial: Confused in my first 1 hour of using piklist’ is closed to new replies.