Tagged: 

Viewing 23 reply threads
  • Author
    Posts
    • #968
      atomworks
      Member

      Hi,

      Posted a widget related question yesterday but not 100% sure it posted or is waiting authorisation, either way, having a different issue.

      I can’t see the widgets in the front-end at all using either custom or demo widgets (stock widgets work as normal), I’m using the latest beta. Any ideas?

    • #970
      Marcus
      Member

      Having the same problem here.

    • #975
      atomworks
      Member

      Bring up the debug messages I seem to get this if it’s any clue:

      Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method PikList_WordPress::get_meta_sql() should not be called statically in /Applications/MAMP/htdocs/dev_sda/wp-includes/plugin.php on line 230

    • #976
      atomworks
      Member

      I’m not sure if this is related to the actual issue. If I change public function get_meta_sql() to public static function get_meta_sql(), and do likewise for the errors that appear in the header too, I can get rid of all the errors but I still get nothing appearing in the widgets area.

    • #991
      atomworks
      Member

      Is there any official word on this, or any ideas what might be causing the problem. I’ve gone round the code and am having trouble identifying what might be the issue. If you guys have an idea I’m happy to keep digging about but at the moment I can’t warrant spending the time on it which is a shame as I’d much rather have this working then make widgets the old fashioned way!

      EDIT: Most I’ve managed to get worked out is that the widget() function in class-piklist-widget.php, which I assume is meant to be what WordPress uses to output widgets doesn’t seem to be called. I’ve dropped in an echo to see if I can get something to happen and that doesn’t work.

    • #995
      atomworks
      Member

      OK, I’ve had a dig about and found part of the problem and enough to smooth over it. It doesn’t however fix the cause of the issue, just the symptoms.

      The symptom (cause unknown):

      class-piklist-universal-widget.php

      Line 86:

      piklist::render(piklist::$paths[$options[1]] . '/parts/widgets/' . $options[2], array(
            'instance' => $instance
            ,'settings' => $instance // NOTE: So beginners have a more understandable name to store variables from the widget
            ,'before_widget' => $before_widget
            ,'after_widget' => $after_widget
            ,'before_title' => $before_title
            ,'after_title' => $after_title
          ));

      This first argument is the one that tells the renderer what template file to use, and this is what is causing the problem, $options[2] most specifically. It should contain the file name (without the extension), but it also has some extra characters crammed in so where it should be ‘example’ it is actually ‘example”;’ ( notice the extra “; )

      This happens on both the demo widgets and custom widgets so I don’t believe I’m doing anything wrong in implementation. It looks like this is being pulled from part of the serialised array that’s in the database and overshooting the end of the value. Here is a sample value I had in my database from a widget attempt.

      a:2:{i:2;a:4:{s:30:"piklist_universal_widget_theme";s:68:"a:1:{i:0;s:50:"piklist_universal_widget_theme--theme--image-block";}";s:9:"demo_text";s:30:"a:1:{i:0;s:12:"Default text";}";s:11:"demo_select";s:24:"a:1:{i:0;s:7:"option1";}";s:16:"demo_colorpicker";s:24:"a:1:{i:0;s:7:"#aee029";}";}s:12:"_multiwidget";i:1;}

      So, not sure what’s causing it and I’ve spent more time then I really should have to try and sort this – but it’s for a good cause 😉

      The (temporary) fix:

      Before the function mentioned above on line 86, insert the following… this simply trims off those troublesome characters.

       // Quick Fix: Widget Rendering Problem
        $options[2] = substr($options[2], 0, -3);

      Then, with any luck you should be back in business. Hopefully the Piklist team can spot what I’ve said and instantly know what’s going on and where it should really be fixed.

    • #996
      Steve
      Keymaster

      Thanks for the help. Unfortunately we won’t be able to look at this until next week.

    • #999
      atomworks
      Member

      No worries, I’m back up and running where I need to be with my quick fix. Just hope my findings help you guys out!

    • #1000
      Marcus
      Member

      Since you are looking at it next week, could you please see about giving it the option to become its own widget (instead of being a drop down selection in the piklist widget), or included in the piklist widget. And if you can turn off the piklist widget if necessary.

      Thanks

      Marcus

    • #1015
      Steve
      Keymaster

      Widgets be fixed! Get the latest Beta. Released today >

    • #1038
      Steve
      Keymaster

      This time it’s REALLY fixed. Beta 5 >

    • #3337
      Gregg
      Member

      Hi Steve

      Is there an option to expose all the widgets as opposed to grouping them together per @marcus comment?

      – Gregg

    • #3338
      Steve
      Keymaster

      @gregg- currently Piklist groups widgets by their plugin or theme. There is no setting to remove this.

      I’m curious why you don’t like this. The WordPress widget page is pretty dysfunctional when there are lots of widgets.

    • #3339
      Gregg
      Member

      I’m stripping away most of the blog related widgets and leaving the custom built ones in place. It’s a cleaner user experience in my case to simply expose all the custom widgets given that there won’t be too many.

    • #4101
      hozefasmile
      Member

      Hi all,

      I have tried to make a new widget reading the tutorial provided in piklist documentation. But its Not showing at all in wp-admin widget.

      If I copy the same files in a piklist plugin created its works as expected, but when I copy that same widget in a theme piklist folder, it not work. (my-theme-folder/piklist/parts/widgets)

      Do you have any idea why its not working there? I want to include widget as part of the theme not want to use an additional plugin to handle it.

      Thanks
      Hozefa

    • #4102
      Marcus
      Member

      I’ve had similar problems in the past. Could you please post the header for the widget box?
      Just the meta code at the top where you instantiate the widget.

      Thanks

      Marcus

    • #4103
      hozefasmile
      Member

      Hi Marcus,

      Thanks for your reply. I have created two files in the directory my-theme-folder/piklist/parts/widgets/
      1. example.php

      <?php
      /*
      Title: Example
      */
      ?>
      <?php echo $before_widget; ?>
      
        <?php echo $before_title; ?>
        
        <?php echo $after_title; ?>
      
          <?php piklist::pre($settings); ?>
          
      <?php echo $after_widget; ?>

      2. example-form.php

      <?php
      
       piklist('field', array(
         'type' => 'text'
         ,'field' => 'post_content'
         ,'label' => __('Example Field')
         ,'description' => __('Field Description')
         ,'attributes' => array(
           'class' => 'text'
         )
       ));
       ?>

      I am using this same code in my custom plugin also. This same code works there but not here if I put it in theme.I am missing something that additionally needed to add to work for theme ?

      Thanks
      Hozefa

    • #4104
      Marcus
      Member

      Yeah, that should work. You’ve got the two pieces you need. widgetname.php and widgetname-form.php
      Have you checked to see that in no other plugin directories you have a duplicate?
      If in your theme you have piklist/parts/widgets/example.php and in one of your plugin folders you have /parts/widgets/example.php this will cause problems.

      Or try and give your -form file a header. Such as:
      <?php
      /*
      Width: 500
      */
      ?>

      Just trying some ideas.

      Marcus

    • #4105
      hozefasmile
      Member

      Hi Marcus,

      I have removed the plugin widget files. Now there is only these widget files in my theme’s directory. I have also added the comment

      /*
      Width: 500
      */

      as you have mentioned in the example-form.php file, but no luck. It still not showing. But whenever I add these in plugin directory its working. Is there something the theme also need additionally to your piklist files? For example I might need to add some code in functions.php file of the theme to make it work?

      Thanks
      Hozefa

    • #4112
      Steve
      Keymaster

      @hozefasmile– A /piklist/ folder inside themes is currently not working correctly in the current version of Piklist. If you make a plugin it will work fine.

      We are putting the finishing touches on the next version of Piklist which will support themes and child themes.

    • #4113
      hozefasmile
      Member

      Hi Steve,

      Thanks for this update. I hope when it get updated you will also update this post with reply. So that anybody coming to this post will get updated on its status.

      Thanks, this plugin is really doing a revolutionary thing for wordpress programming 🙂

      Hozefa Saleh

    • #4116
      Steve
      Keymaster

      @hozefasmile

      The next major version of Piklist that is released to WordPress.org will have this feature. So, you will just have to upgrade for it to work.

      We’re so happy you love Piklist. Would you mind leaving a quick 5 Star review on WordPress.org? It really goes a long way to helping the project.

    • #4119
      hozefasmile
      Member

      Sure,

      I have ranked your plugin with 5 star on wordpress. You deserve it. Best wishes for making this plugin more valuable and powerful!

    • #4120
      Steve
      Keymaster

      Thanks so much!

Viewing 23 reply threads
  • The topic ‘Widgets not showing’ is closed to new replies.