Recent Topics

Support Nested dynamic fields

Started by on Nov 27, 2017 – Contents updated: May 01, 2018

Nov 27, 2017 13:10    

Nov 27, 2017 13:30

	
	function GetDefaultSettings( & $params )
	{
		global $app_version;
		
		$type = version_compare( $app_version, '6.6.5', '>' ) ? 'array:array:string' : 'array';
		return array(
			'plugin_sets' => array(
				'label' => T_('Level 1'),
				'note' => T_(''),
				'type' => $type,
				'entries' => array(
		
						'a_color' => array(
									'label' => T_('Color'),
									//'note' => T_('E-g: #444444 for light-black'),
									'defaultvalue' => '#fed136',
									'type' => 'color',
								),
		
						'plugin_sets_2' => array(
							'label' => T_('Level 2'),
							'note' => T_(''),
							'type' => $type,
							'entries' => array(

										'color' => array(
												'label' => T_('B Color'),
												//'note' => T_('E-g: #444444 for light-black'),
												'defaultvalue' => '#fed136',
												'type' => 'color',
											),

										'text' => array(
												'label' => T_('B Text'),
												//'note' => T_('E-g: #444444 for light-black'),
												'defaultvalue' => 'Foo Bar',
												'type' => 'text',
											),

											'plugin_sets_3' => array(
																'label' => T_('Level 3'),
																'note' => T_(''),
																'type' => $type,
																'entries' => array(

																'color' => array(
																			'label' => T_('Color'),
																			//'note' => T_('E-g: #444444 for light-black'),
																			'defaultvalue' => '#fed136',
																			'type' => 'color',
																			),

																'text' => array(
																			'label' => T_('Text'),
																			//'note' => T_('E-g: #444444 for light-black'),
																			'defaultvalue' => 'Foo Bar',
																			'type' => 'text',
																			),

																	'plugin_sets_4' => array(
																					'label' => T_('Level 4'),
																					'note' => T_(''),
																					'type' => $type,
																					'entries' => array(

																										'color' => array(
																													'label' => T_('Color'),
																													//'note' => T_('E-g: #444444 for light-black'),
																													'defaultvalue' => '#fed136',
																													'type' => 'color',
																													),

																										'text' => array(
																													'label' => T_('Text'),
																													//'note' => T_('E-g: #444444 for light-black'),
																													'defaultvalue' => 'Foo Bar',
																													'type' => 'text',
																													),
																										)))))))));
	}

Dec 12, 2017 13:05

Is it possible to get some feedback on this request please?

Dec 23, 2017 08:26

@achillis I'm merging your PR to my forked repo but I get many conflicts at _plugin.funcs.php. Maybe the conflicts have been introduced with modifications done to that file after you sent the PR.

Can you please take a look at the current code and make the appropriate changes to yours in order to achieve a conflicts-free merge and keep your feature working as you meant?

Thank you.

Dec 24, 2017 07:26

@mgsolipa wrote earlier:

...but I get many conflicts at _plugin.funcs.php. Maybe the conflicts have been introduced with modifications done to that file after you sent the PR.

Thank you.

That is exactly what happened. I will look into it @mgsolipa

Dec 25, 2017 08:47

@mgsolipa conflicts resolved, briefly tested again to be sure and it looks good. COuld you try merging with your repo and check it again on your end?

Jan 01, 2018 07:59

Not sure what happened with the first (initial) post of this thread, but I am certain that I did not post this??

Jan 02, 2018 23:41

Temporary caching bug in 6.9.5 :/

Mar 15, 2018 23:20

Any feedback for this request? Another one from last year...

Apr 05, 2018 22:04

This looks like a horrible UI to me. Why would you want to have these nested panels? My head hurts just looking at the screenshot.

Apr 05, 2018 22:12

The screenshot illustrates testing only, and would surely never be used in practice. This ability works great though for another requested dynamic feature (Select_Input) Nested Inside types array:array:string

Do you need a screenshot that is more inline with what will work in practice?

Apr 05, 2018 23:16

Yes please show me a real use case scenario. Thanks.

Apr 06, 2018 14:00

@fplanque believe this or not, but I have spent 6 hours trying to construct a pitch that you will buy into, and its easier to see its value if it is there, like a tool in a toolbox that is available when its needed, rather than having to run to the hardware store 100 times. Yes not everyone will use it, but it will be available if needed.

So here goes...

@fplanque wrote earlier:

This looks like a horrible UI to me. Why would you want to have these nested panels? My head hurts just looking at the screenshot.

This is because Dynamic Fieldsets (array:array:string) is useful, but not in every instance, sometimes one needs a simpler solution, hence the PULL REQUEST[1] for a simpler option. With this option available, they can work together and be visually pleasant and offer a clean UI that will make configurations easier, but in order for this to be supported we need Support for nested dynamic fields, and the Feature select_input

Now if one has a dynamically created item, with another nested dynamically option, it looks cleaner. See Screenshot 1

Please let me also remind you that I requested this [1] where you replied:

@fplanque wrote earlier:

Ok, thanks. We'll look at this.

Please, I have invested allot of time in this. I know you like visual cues, so I made you a nice info graphic to win you over.

[1] http://forums.b2evolution.net/feature-request-dynamic-input-groups

Apr 10, 2018 01:32

Thanks for the overkill infographic, but really the only part I need is the one with the screenshots (and a mention that you are depicting a "survey widget" use case).

And I see horrible UI again, impossible to understand what it is for.

A panel title "custom fields". I don't even begin to understand how that is related to a survey plugion/widget.

... containing a single panel titled "#0". What do we need a "#0" box for?

... containing a list that can be grown with an "Add" button. That part I understand. But why do we have 2 horrible boxes around that? No shown in your use case.

Also note: what is the "List Item" button for ? (the one before the "Add" button)

May 01, 2018 13:10

@fplanque @achillis I have tested new setting type select_input, please see my screenshot. As I understand the new select_input is a multiple version of existing type input_group to allow add several such groups dynamically.

This post has 2 feedbacks awaiting moderation...


Form is loading...

blogtool – This forum is powered by b2evolution CMS, a complete engine for your website.