Viewing 2 reply threads
  • Author
    Posts
    • #4930
      erikkubica
      Member

      Hi,

      Steve thank you for reply in article. I am still confused how it works on this new workflow(or what the workflow means, what it corresponds for)

      I will be happy if someone will help me to migrate actual code to new structure.

      Current structure for settings page(theme options) is:
      piklist/parts/settings/zm_settings[_basic, _advanced, _socials,…].php

      Registering setting page i do like:

      
      add_filter('piklist_admin_pages', 'piklist_theme_setting_pages');
      
      function piklist_theme_setting_pages($pages) {
          $pages[] = array(
              'page_title' => __('Theme Options')
              , 'menu_title' => __('Theme Options', 'piklist')
              , 'sub_menu' => 'themes.php' //Under Appearance menu
              , 'capability' => 'manage_options'
              , 'menu_slug' => 'zm_settings'
              , 'setting' => 'zm_theme_settings'
              , 'menu_icon' => plugins_url('piklist/parts/img/piklist-icon.png')
              , 'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png')
              , 'single_line' => true
              , 'default_tab' => 'Basic'
              , 'save_text' => __('Save settings')
          );
      
          return $pages;
      }
      

      content of zm_settings_*.php looks like this:

      
      <?php
      /*
        Setting: zm_theme_settings
        Tab: Facebook API
        Tab Order: 2
       */
      
      piklist('field', array(
          'type' => 'text'
          , 'field' => 'facebook_app_id'
          , 'label' => 'FB App ID'
          , 'description' => ''
          , 'help' => 'Id of app that is allowed for domain.'
          , 'value' => ''
          , 'attributes' => array(
              'class' => 'text'
          )
      ));
      ... other fields
      

      As i see in docs, workflows is defined in ..parts/workflows so now i need to move things from settings to workflows? How I register these new setting page? Is there any different in accessing data?

      
      /*
      Title: My Tab
      Order: 10
      Flow: My Flow
      */
      

      Recommendation: I think docs for these trunk versions should be created. And add some select box to documentation to let users choose witch version they want to read.

      Thank you

    • #4941
      Steve
      Keymaster

      @erikkubica– Real sorry for the confusion. Hopefully, this is the last time we manage two different versions of Piklist. Here’s the doc for Workflows in 0.9.9.x

      Essentially, you do three things:
      1) Create a Workflow Header file: This goes in the /workflows/ folder, and tells the entire Workflow which pages to display on.

      2) Create a Workflow tab: This also goes in the /workflows/ folder, and is just a tab assigned to the header.

      3) Assign your settings sections: These stay in your /settings/ folder. You should just have to add two parameters to the commment block: Tab and Flow. Here’s an example:

      Tab: My Tab
      Flow: My Flow
      

      Does that make more sense?

    • #4946
      erikkubica
      Member

      Yes, now it´s clear how these flows connects with tabs and pages,

      Thank you

Viewing 2 reply threads
  • The topic ‘Setting page on 0.9.9.6 with new flow’ is closed to new replies.