Forum Replies Created
-
AuthorPosts
-
kplanetaMemberI’ve inspected the problem.
Calls for admin-ajax look ok. In the timeline > frames waterfall diagram I see that parsing HTML took a whole 3,5secs. Dev Tools gives a notice “Forced synchronous layout is a possible performance bottleneck.”. My guess is that the javascript applies classes and ids to elements and the browser keep repainting the HTML after each new addition. Does Piklist add any on the fly?
kplanetaMemberThere you go
piklist('field', array( 'type' => 'group' ,'field' => $prefix. 'extra_text' ,'label' => __('Teksty informacyjne', 'piklist-demo') ,'list' => false // wraps fields in <ul> ,'fields' => array( array( 'type' => 'textarea' ,'field' => 'before_dishes' ,'label' => 'Informacja nad listą dań' ,'columns' => 6 ,'attributes' => array( 'rows' => 4 ,'cols' => 50 ,'maxlength' => 200 ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 200 ) ) ) ) ,array( 'type' => 'textarea' ,'field' => 'after_dishes' ,'label' => 'Informacja pod listą dań' ,'columns' => 6 ,'attributes' => array( 'rows' => 4 ,'cols' => 50 ,'maxlength' => 200 ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 200 ) ) ) ) ) )); piklist('field', array( 'type' => 'group' ,'field' => $prefix. 'dish_sizes_names' ,'label' => __('Nazwy wielkości porcji', 'piklist-demo') ,'description' => __('Uzupełnij jeśli oferujesz dania o wielu wielkościach porcji.', 'piklist-demo') ,'fields' => array( array( 'type' => 'text' ,'field' => 's_dish_name' ,'label' => 'S' ,'columns' => 3 ,'attributes' => array( 'placeholder' => 'np. Dla dzieci' ,'maxlength' => 20 ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 20 ) ) ) ) ,array( 'type' => 'text' ,'field' => 'm_dish_name' ,'label' => 'M' ,'columns' => 3 ,'attributes' => array( 'placeholder' => 'np. Na mały głód' ,'maxlength' => 20 ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 20 ) ) ) ) ,array( 'type' => 'text' ,'field' => 'l_dish_name' ,'label' => 'L' ,'columns' => 3 ,'attributes' => array( 'placeholder' => 'np. Na duży głód' ,'maxlength' => 20 ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 20 ) ) ) ) ,array( 'type' => 'text' ,'field' => 'xl_dish_name' ,'label' => 'XL' ,'columns' => 3 ,'attributes' => array( 'placeholder' => 'np. Dla dwojga' ,'maxlength' => 20 ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 20 ) ) ) ) ) )); piklist('field', array( 'type' => 'select' ,'field' => $prefix . 'display_portions_names' ,'label' => 'Gdzie wyświetlać nazwy porcji?' ,'value' => 'no' // default ,'choices' => array( 'above_list' => 'Nad całą listą dań' ,'in_dishes' => 'Przy potrawach o wielu rozmiarach porcji' ) ,'sanitize' => array( array( 'type' => 'html_class' ) ) )); piklist('field', array( 'type' => 'select' ,'field' => $prefix . 'style_of_list' ,'label' => 'W ilu kolumnach wyświetlać dania?' ,'value' => 'list1col' // default ,'choices' => array( 'list1col' => __( '1', 'cm2b' ) ,'list2col' => __( '2', 'cmb2' ) ) ,'sanitize' => array( array( 'type' => 'html_class' ) ) )); piklist('field', array( 'type' => 'group' ,'field' => $prefix. 'dishes' ,'label' => __('Lista dań', 'piklist-demo') ,'list' => false // wraps fields in <ul> ,'add_more' => true ,'fields' => array( array( 'type' => 'text' ,'field' => 'name' ,'label' => 'Nazwa' ,'columns' => 12 ,'attributes' => array( 'maxlength' => '50' ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 50 ) ) ) ) ,array( 'type' => 'textarea' ,'field' => 'descr' ,'label' => 'Opis' ,'columns' => 12 ,'attributes' => array( 'rows' => 3 ,'maxlength' => 160 ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 160 ) ) ) ) ,array( 'type' => 'number' ,'field' => 'price_s' ,'label' => 'Cena S' ,'columns' => 3 ,'attributes' => array( 'maxlength' => 6, 'min' => '0', 'max' => '999', 'step' => '0.01' ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 6 ) ) ) ) ,array( 'type' => 'number' ,'field' => 'price_m' ,'label' => 'Cena M' ,'columns' => 3 ,'attributes' => array( 'maxlength' => 6, 'min' => '0', 'max' => '999', 'step' => '0.01' ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 6 ) ) ) ) ,array( 'type' => 'number' ,'field' => 'price_l' ,'label' => 'Cena L' ,'columns' => 3 ,'attributes' => array( 'maxlength' => 6, 'min' => '0', 'max' => '999', 'step' => '0.01' ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 6 ) ) ) ) ,array( 'type' => 'number' ,'field' => 'price_xl' ,'label' => 'Cena XL' ,'columns' => 3 ,'attributes' => array( 'maxlength' => 6, 'min' => '0', 'max' => '999', 'step' => '0.01' ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 6 ) ) ) )/* ,array( 'type' => 'checkbox' ,'field' => 'specialstyle' ,'label' => 'Wyróznij graficznie' ,'columns' => 6 ,'value' => 'yes' ,'choices' => array( 'yes' => '' ) ) ,array( 'type' => 'text' ,'field' => 'specialtext' ,'label' => 'Wyróżnij tekstem' ,'columns' => 6 ,'attributes' => array( 'maxlength' => '30' ,'placeholder' => 'np. "Nowość"' ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 30 ) ) ) )*/ ,array( 'type' => 'hidden' ,'field' => 'product_id' ) ) ));
kplanetaMemberTo make tabs work you need to set up a workflow. It’s all written in the docs.
kplanetaMemberHi,
I still have problems with sanitization of fields in settings pages. I’ve noticed that piklist sanitizes fields when other fields give an error (!) e.g. when they are required but have no content. When all required fields have some input than sanitization doesn’t work. I’ve recorded a video to illustrate > https://dl.dropboxusercontent.com/u/16604210/Piklist%20-%20saving%20settings%20and%20sanitization.wmv
October 29, 2015 at 11:18 am in reply to: How can I display meta boxes only on pages with no templates attached? #4786
kplanetaMemberWorks. Thank you 🙂
I think it’s worth writing it down here > https://piklist.com/user-guide/docs/file-structure/meta-boxes/
kplanetaMemberI didn’t think about it that way. Thank you Steve 🙂
kplanetaMemberHi Kevin,
I’m sorry for the delay, but I forgot about this post.
For starters, let me be more precise. The issue I’m having is with settings pages divided into workflow tabs. I don’t know how it works in ordinary settings pages. I work on Piklist v 0.9.9.4 and WP MU 4.3.1
Now the issue.
I know that I can write literally e.g.
<h3>title</h3>in the piklist’s settings setup. However, when I do this then h3 gets displayed at the top of the page instead of the place where I left it. I will give an easy example.Let’s say that sttings for my settings page looks like this:
piklist field settings
piklist field settings
piklist field settings
<h3>sth</h3>
piklist field settings
piklist field settingsNow. This code outputs page with <h3> at the top. I don’t know why this happens but I’m getting this every single time. No matter where I put h3.
BTW. I’ve also noticed that adding a table in plain html (no mattter where the code is put in he settings page) makes all the fields disappear.
kplanetaMemberSure. I’ve added the description HTML tag manually. If I add it via the
'description' => '...'nothing shows up.piklist('field',array( 'type' => 'html' ,'label' => 'Location' ,'value' => '<div id="project_map" style="height:350px;"></div><p class="piklist-field-description description">Przeciągnij znacznik w miejsce gdzie znajduje się restauracja</p>' ));
kplanetaMemberHi. Unfortunately I don’t remeber now on what page the problem occured (it didn’t show up always). When I come accross it again I will let you know exactly.
kplanetaMemberUPDATE 2 & Clarification.
Case 1 above takes place in “add_more” groups. Haven’t texsted it in non-add-more fields.
There’s something definitely wrong with data sanitization in “add_more” groups since now I’ve checked how does the “text_field” sanitization type works on editor in grouped add-more fields and the code looks exactly the same, that is no HTML is stripped. Hence, I believe the sanitization doesn’t work on fields in add more groups.
October 14, 2015 at 2:03 pm in reply to: No line breaks in admin > add more group > textarea and wysiwyg #4583
kplanetaMemberWow. That sure was quick. 5 stars rating for you was posted 20 secs ago 🙂
-
AuthorPosts