redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Group Field

Open Pushplaybang opened this issue 13 years ago • 9 comments

Hey

Group field title and subtitle don't seem to be working or setup.

Also, is the "slides" field type - not really a preset "group" ? Seems a little silly, unless of course I'm missing something, must say the slides field looks a little nicer, would be great if that carried through to the groups field.

Pushplaybang avatar Dec 01 '13 14:12 Pushplaybang

Group field is still under development. Yes, the slides and group in an idea world should work the same. The group field will eventually replace the slides. ;)

dovy avatar Dec 02 '13 06:12 dovy

cool. thanks for the info, will keep an eye out for that.

Pushplaybang avatar Dec 10 '13 05:12 Pushplaybang

@dovy - I know its under active development, but currently it seems as though the group field outputs its subfields as if they were normal fields - each subfield in its own array - are you going to stick to this strategy or are you planning to output a nested array like the slides field does currently ?

Pushplaybang avatar Dec 10 '13 06:12 Pushplaybang

Can you code PHP? If so, why not give it a try?

kprovance avatar Dec 10 '13 06:12 kprovance

@Pushplaybang Still on the fence. Do we want to have groups within their own array, or as a normal field. I think we're leaning towards a normal field, but I am not sure. Thoughts?

dovy avatar Dec 10 '13 07:12 dovy

@dovy, I'm happy either way, just curious as to your plans, In my opinion it would probably be easier for most to loop through a single array (like you have the slides field type output currently) as I imagine it would be easier to work with each groups values in that manner.

In much the same way as I might want to pull out an image, then title, then subtitle then button text, then button link for each slide inside a foreach loop, I would probably want to do the same if those groups were used as a) a repeatable set of fields for office / store locations to be displayed on a custom google map, b) key contact people output in the sidebar of a contact page c) replacing the slides field type, etc etc. Maybe I'm not thinking about the same use cases as you are? thoughts ?

I don't think its much harder the way you're doing it now, but maybe a little more PT, what are the motivations for the method you're going with currently ?

Pushplaybang avatar Dec 10 '13 13:12 Pushplaybang

The group field right now works as an array of groups.

vertigo7x avatar Dec 10 '13 14:12 vertigo7x

@vertigo7x - hmmm, maybe theres something wrong with the way I'm doing it, I was getting something a little different....

currently I'm getting this

[welcome-links] => Array
        (
            [0] => Array
                (
                    [slide_title] => #url1
                    [slide_sort] => 0
                )

            [1] => Array
                (
                    [slide_title] => #url2
                    [slide_sort] => 1
                )

        )

    [button-text] => Array
        (
            [0] =>  link 1
            [1] => link 2
        )

    [button-link] => Array
        (
            [0] => #url1
            [1] => #url2
        )

where as the slides field type is producing this :

[home-slides] => Array
    (
        [0] => Array
            (
                [title] => title
                [description] => this is a description
                [url] => http://localhost/zz_nona-foundation/wp-content/uploads/2013/11/09.jpg
                [sort] => 0
                [attachment_id] => 20
                [thumb] => http://localhost/zz_nona-foundation/wp-content/uploads/2013/11/09-150x150.jpg
                [image] => http://localhost/zz_nona-foundation/wp-content/uploads/2013/11/09.jpg
                [height] => 1667
                [width] => 2500
            )

        [1] => Array
            (
                [title] => another title
                [description] => another description
                [url] => http://localhost/zz_nona-foundation/wp-content/uploads/2013/11/nose-up.jpg
                [sort] => 1
                [attachment_id] => 55
                [thumb] => http://localhost/zz_nona-foundation/wp-content/uploads/2013/11/nose-up-150x150.jpg
                [image] => http://localhost/zz_nona-foundation/wp-content/uploads/2013/11/nose-up.jpg
                [height] => 2806
                [width] => 4106
            )

    )

Checked my settings code against the sample config all looks good.

my question is really is the first variation here to stay? and if you're open to suggestions the second seems more logical to me personally.

Pushplaybang avatar Dec 10 '13 15:12 Pushplaybang

ok, apparently I'm being nob, update didn't stick......updating to the latest version cleared this up it now looks like groups our output in the way slides were.

Pushplaybang avatar Dec 10 '13 16:12 Pushplaybang