Forum Replies Created

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • in reply to: Odd application of the default field styling #5349
    kplaneta
    Member

    I’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?

    in reply to: Odd application of the default field styling #5334
    kplaneta
    Member

    There 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'
    		)
    	)
    ));
    in reply to: Settings page tabs not working #4860
    kplaneta
    Member

    To make tabs work you need to set up a workflow. It’s all written in the docs.

    in reply to: Sanitizing doesn't work for settings pages #4787
    kplaneta
    Member

    Hi,

    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

    kplaneta
    Member

    Works. Thank you 🙂

    I think it’s worth writing it down here > https://piklist.com/user-guide/docs/file-structure/meta-boxes/

    in reply to: How to divide settings page with h3 sections #4764
    kplaneta
    Member

    I didn’t think about it that way. Thank you Steve 🙂

    in reply to: How to divide settings page with h3 sections #4762
    kplaneta
    Member

    Hi 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 settings

    Now. 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.

    in reply to: Description doesn't show up in HTML field #4742
    kplaneta
    Member

    Sure. 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>'
    ));
    in reply to: MySQL error from Query Monitor #4638
    kplaneta
    Member

    Hi. 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.

    in reply to: Sanitization problems & stripsplashes_deep #4604
    kplaneta
    Member

    UPDATE 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.

    kplaneta
    Member

    Wow. That sure was quick. 5 stars rating for you was posted 20 secs ago 🙂

Viewing 11 posts - 16 through 26 (of 26 total)