Skip Navigation

[Resolved] Display Repeatable Fields in WordPress Backend only as Horizontal view

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 5 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1523335
Bildschirmfoto 2020-02-23 um 09.42.49.png

I want to use only the horizontal view of repeatable fields in my wordpress backend:

e.g. hidden link

Is there a way to switch off the vertically view (rgview=vertical) OR set rgview=horizontal as DEFAULT for all my toolset views?

#1524869

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no master setting available to change how Repeating Field Groups are displayed. I think it should be added and for that I suggest you should raise your voice by filing a new feature request using the following link:
=> https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

However - I think I am able to find a workaround that will help you to resolve your issue.

Please try to add the following code to your current theme's functions.php file:

add_filter('admin_url','func_display_rfg_horizontal_by_default');
function func_display_rfg_horizontal_by_default( $link ) {
	global $post_type;
    if($post_type=='student') {
        $params['rgview'] = 'horizontal';
    }
    $link = add_query_arg( $params, $link );

    return $link;
}

Where:
- Please replace student with your actual post-type slug value.

The above code will help you to display the Repeating field group in the horizontal display by default.

#1525013

Hi Minesh,

thx so far, I tried to use your code snippet and it seems to work for the post-type I´ve used to test it. BUT: When putting the code into the functions.php I can´t edit the post of other post-types anymore?? When deleting the code-snippet everythings works fine again.

ERROR = the link of the post is not available anymore

I´m not that familiar with PHP or JS to find out what happens there. Another question: I´ve use different post-types, and I want only the horizontal view for all, not only a single post-type.

THX Christoph

#1525133

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please try to use the following code:

add_filter('admin_url','func_display_rfg_horizontal_by_default');
function func_display_rfg_horizontal_by_default( $link ) {
    global $post_type;

  $list_of_post_types = array('student','post','page');
    if(in_array( $post_type, $list_of_post_types )) {
        $params['rgview'] = 'horizontal';
        $link = add_query_arg( $params, $link );
}
   
 
    return $link;
}

- where you can amend the list of post types with $list_of_post_types.

If still, your issue persists - please share admin access details and list of post types you want to apply the horizontal view.