Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field-Keys #6

Open
FFroebel opened this issue Dec 20, 2017 · 8 comments
Open

Field-Keys #6

FFroebel opened this issue Dec 20, 2017 · 8 comments

Comments

@FFroebel
Copy link

Hi,
I really like your code. But I don't understand, where I get the field-keys. They are allready setted? I have to generate them?
Is it possible to combine the repeater-ajax-load-more and dynamic-fields-on-relationship?
Thanks for helping!
Best

@Hube2
Copy link
Owner

Hube2 commented Dec 20, 2017

Field keys are generated by ACF. You can see these when looking at a field group by selecting to show them under page options.

Combining things is likely possible. This repo is just meant to be simple examples of how to do specific things for other developer to build on and to show how some things are possible.

@FFroebel
Copy link
Author

Hey Hube2,
thank you for your reply!
You also have a group key? Is it also generated by ACF? I allready get the field keys, but I'm not able to find the group keys, only "group_no".
Thank you in advance!

@Hube2
Copy link
Owner

Hube2 commented Jan 23, 2018

The group key is saved as the post slug. You can also see the group key if you do an export of the field group.

@Hube2 Hube2 closed this as completed Jan 23, 2018
@Hube2 Hube2 reopened this Jan 23, 2018
@FFroebel
Copy link
Author

FFroebel commented Jan 23, 2018

If I do an export of the field group, I don't get a group key. Here you see the exported php. For exported xml, I get "group_no"

if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_teamdetails',
'title' => 'Teamdetails',
'fields' => array (
array (
'key' => 'field_5923fd3bde3eb',
'label' => 'Publikationen',
'name' => 'publikationen',
'type' => 'relationship',
'return_format' => 'object',
'post_type' => array (
0 => 'publication',
),
'taxonomy' => array (
0 => 'all',
),
'filters' => array (
0 => 'search',
),
'result_elements' => array (
0 => 'post_type',
1 => 'post_title',
),
'max' => '',
),
array (
'key' => 'field_59c3783d131cf',
'label' => 'Assistance',
'name' => 'assistance',
'type' => 'relationship',
'return_format' => 'object',
'post_type' => array (
0 => 'portfolio',
),
'taxonomy' => array (
0 => 'all',
),
'filters' => array (
0 => 'search',
),
'result_elements' => array (
0 => 'featured_image',
1 => 'post_type',
2 => 'post_title',
),
'max' => '',
),
array (
'key' => 'field_59c8e4a78cfd1',
'label' => 'Research',
'name' => 'team1',
'type' => 'relationship',
'return_format' => 'object',
'post_type' => array (
0 => 'portfolio',
),
'taxonomy' => array (
0 => 'all',
),
'filters' => array (
0 => 'search',
),
'result_elements' => array (
0 => 'post_type',
1 => 'post_title',
),
'max' => '',
),
array (
'key' => 'field_59c8e46f44eda',
'label' => 'Supervision',
'name' => 'supervision',
'type' => 'relationship',
'return_format' => 'object',
'post_type' => array (
0 => 'portfolio',
),
'taxonomy' => array (
0 => 'all',
),
'filters' => array (
0 => 'search',
),
'result_elements' => array (
0 => 'featured_image',
1 => 'post_type',
2 => 'post_title',
),
'max' => '',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'tshowcase',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
0 => 'custom_fields',
1 => 'comments',
2 => 'revisions',
3 => 'format',
),
),
'menu_order' => 0,
));
}

@Hube2
Copy link
Owner

Hube2 commented Jan 23, 2018

You're using ACF4. Most of the examples here will not work with ACF4 because they rely on the JavaScript included in ACF5. The JS for ACF4 would be completely different.

@FFroebel
Copy link
Author

Ok, thanks! Then I'll buy ACF5 and try again....

@FFroebel
Copy link
Author

Hi again,
I bought ACF5. Now I got the group key. The 'show more'-button works also. Could you may help me, how I can include the get_the_title() and get_the_post_thumbnail() instead of the subfield in the group_xxx.json file?
Thanks a lot!

@Hube2
Copy link
Owner

Hube2 commented Jan 31, 2018

the title and post thumbnail are not ACF fields and will not be in anything exported by ACF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants